Linux / UNIX: Rules For Naming File And Directory Names

Linux / UNIX: Rules For Naming File And Directory Names

In Linux and Unix systems, there are a few rules and conventions that you should follow when naming files and directories:

  1. Avoid using spaces in file and directory names: It is generally best to avoid using spaces in file and directory names, as spaces can cause issues when working with the command line. Instead, use an underscore (_) or hyphen (-) to separate words in a file or directory name.

  2. Do not use special characters: Avoid using special characters such as *, %, #, and ! in file and directory names, as these characters may have special meanings in certain contexts.

  3. Do not use reserved words: There are a number of reserved words in Linux and Unix that should not be used as file or directory names, such as home, etc, and dev.

  4. Use lowercase letters: It is generally a good idea to use lowercase letters in file and directory names, as some systems are case-sensitive and may treat file.txt and File.txt as two different files.

  5. Keep file names short: While there is no strict limit on the length of file and directory names, it is generally a good idea to keep names short and concise to avoid issues when working with the command line.

By following these rules and conventions, you can help ensure that your file and directory names are compatible with Linux and Unix systems.

Created Time:2017-10-29 22:08:57  Author:lautturi