Linux and Windows file name length limits

Source: Internet
Author: User

The length limit for a Linux file name is 255 characters

Fully qualified file names under Windows must be less than 260 characters, and folder names must be less than 248 characters.

limitations of the number of Linux items, folders, and file name lengths

The following test results are tested without optimizing or altering the kernel.

1. Test Purpose: Ext3 file system filename Maximum character length
Test platform: rhel5u3_x64
Test process:
Lenth= ' for i in {1..255};d o for x in A;do echo-n $x;d one;done '
Touch $LENTH
When added to 256, touch error, File name too long
Under the Linux system, the file/folder name within the Ext3 file system can only support up to 127 Chinese characters, while English can support 255 character

2. Test Purpose: Ext3 file system The number of sub-folders limit
Test platform: rhel5u3_x64
Test process:
[[email protected] maxdir]# for i in {1..32000};d o mkdir $i;d One
Mkdir:cannot Create directory ' 31999 ': Too many links
Mkdir:cannot Create directory ' 32000 ': Too many links
The number of subfolders at the Ext3 file system level is 31998 (each).
Linux is required for CPU search efficiency, and to change the number is probably to compile the kernel again.

3. Test purpose: The maximum number of files in a single folder under the Ext3 file system
Test platform: rhel5u3_x64
Test process:
The maximum number of files under a single folder does not seem to be particularly restrictive, and is limited by the number of inode limits for the file system in which it resides:
Df-i either use Tune2fs-l/dev/sdax or dumpe2fs-h/dev/sdax to view the number of available inode, and the latter two commands
The output is the same, but with DF the number of available inode will be somewhat error, so far unclear what the cause.

Two solutions are often used on the Web:
1) Once again MKFS,EXT3 default block size 4096 Bytes,block set a smaller number of inode settings larger
2) temporarily resolve using the loopback file system:
Create a large file in/usr (also available elsewhere), then make the loopback file system and move the original file to this
File system, and mount it to the appropriate location in/usr. This can greatly reduce the number of files in your/usr. But the system
Performance can be a bit of a loss.

4. Test Purpose: Open file limit (file handle, File description descriptor)
Test platform: rhel5u3_x64
Ulimit-n 65535 settings, or/etc/security/limit.conf set the number of open files, number of processes, CPU, etc.

Original Address http://dx.ylmf.net/read.php?tid=1330799

Linux and Windows file name length limits

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.