Linux file (directory) naming rules

After introducing Linux system directory structure, the reader will want to know how to name a file or directory.

 

We know that in the Linux system, all files, since it is a file, it must have a file name. Compared with other systems, Linux operating system requirements for the file or directory name is relatively relaxed.

Linux system, naming files and directories as follows:

  1. In addition to the character "/", all characters can be used, but be careful, the directory name or file name, use some special characters is not a wise move. For example, naming should avoid the use of <,> ,? * And non-printing characters and so on. If a file name contains special characters, such as space, then when accessing the file you need to use quotation marks to enclose the file name.
  2. Length of the directory name or file name can not exceed 255 characters.
  3. Directory or file names are case-sensitive. As DOG, dog, Dog and DOg, are different from each other in the name of the directory or file name, but use character case to distinguish between different file or directory, unwise.
  4. Unlike Windows operating system, the file extension has no special meaning for the Linux operating system, in other words, Linux systems are not open to the file extension of the file type partition. For example, dog.exe just a file whose extension .exe file does not mean that this is necessarily an executable file.

Note that, in the Linux system, the hardware is file, also have their own file name. Linux system kernel udev Device Manager will automatically name of the hardware device to regulate, to let the user through the device file name, you can almost guess at the property and equipment related information.

udev Device Manager will run as a process, and listens for the signal emitted by the kernel to manage the device file located in the / dev directory.

Table 1 set out a common hardware device name Linux file system.

Table 1 Linux hardware device file name
hardware equipment file name
IDE devices / Dev / hd [ad], IDE devices now has rarely met, it is generally the hard disk apparatus will begin to / dev / sd.
SCSI / SATA / U disk / Dev / sd [ap], a host can have multiple hard disks, so the system uses a ~ p 16 representative of a different hard disk.
Floppy /dev/fd[0-1] 
printer /dev/lp[0-15]
CD-ROM /dev/cdrom
mouse /dev/mouse
Tape Drives / Dev / st0 or / dev / ht0
Published 33 original articles · won praise 0 · Views 407

Guess you like

Origin blog.csdn.net/linuxanz/article/details/103474875