Linux Rules for file names

www‮iruttual.‬.com
Linux Rules for file names

In Linux, there are a few rules to follow when naming files:

  1. File names are case sensitive: In Linux, file names are case sensitive, which means that "file.txt" and "File.txt" are considered to be different files.

  2. File names can include any printable ASCII character: File names can include any printable ASCII character, including letters, numbers, and punctuation. However, some characters have special meaning in the shell and should be avoided. These include:

  • The forward slash (/) character, which is used to separate directories in the file path.
  • The null character (\0), which is used to terminate strings in C and can cause problems when used in file names.
  • The vertical bar (|) character, which is used to separate commands in the shell.
  • The ampersand (&) character, which is used to run commands in the background in the shell.
  1. File names can be up to 255 characters long: File names in Linux can be up to 255 characters long, including the extension.

  2. File names should not contain spaces: File names should not contain spaces, as the shell treats spaces as delimiters. To include a space in a file name, you can use an underscore (_) or a hyphen (-) instead.

  3. File names should not start with a dash (-): File names should not start with a dash (-), as this can cause problems when running commands in the shell.

Note: These are just a few general rules to follow when naming files in Linux. Some applications or programs may have their own naming conventions or restrictions.

Created Time:2017-10-30 10:17:38  Author:lautturi