Linux note: the file name

file name

Linux systems are case sensitive English characters. For example, myfile, Myfile and myFILE represented three different files. Similarly, the user login name and password are also case-sensitive (here follows the naming Unix and the C language). Naming directory and file naming rules are the same. Unless there are special reasons, otherwise the user to create files and directories you want to use lowercase characters. Most Linux commands can also use lowercase characters. File name length under Linux system to a maximum of 256 characters. Typically, the file name characters include: letter, number, (point), ".", " _" (Underscore) and " -" (hyphen). Linux allows the use of other symbols other than the above symbols in the file name, but does not recommend that you do so. Some turn ideographic characters (that is, the character is borrowing system, represents some special meaning)

Linux has a special meaning in command interpreter (shell) in (shell similar to the command processor under DOS COMMAND.COM). Such a turn and characters: "?" (Question mark), "*" (asterisk), "" (space), "$" (currency symbol), "&", expanding number and so on. In the file name should try to avoid using these characters. File names that include "" (space), but the user is encouraged to " _instead of" (underscore). " /" Representative of the root of the directory tree can also be used as a path name in the separator (at similar DOS " \), thus" / "does not appear in the file name. DOS and the like". ", And" .. ", respectively, to mean "the current directory" and "parent directory", so they can not be used as the file name.

As in DOS, we can not name the file or .. (dot or two-point) - which represent the current directory and the parent directory of the current directory (the parent directory). This is entirely consistent with the DOS.

Here are some of the characters turn and its significance:

  • *= Matches any sequence of characters of length greater than zero. Except at the beginning of the. (Dot) file name.
  • ``? = Matches any single character
  • [abC1]= Enumerated set used to match any single character. Ratio, the set of 'a', 'b', C ',' 1 'composition.
  • [a-z] = Matches any small print letters
  • [A-F] Matches any uppercase =
  • [0-9] = Matches any single digit
  • [a-zA-Z0-9] = Matches any letter (case) or digital.
  • \(Backslash) is a special character. It shields the special meaning of the subsequent special letters (turn back), whichever is the only character that the literal meaning of the symbol represents.

Guess you like

Origin www.cnblogs.com/wbyixx/p/12185446.html