Naming files

A file name can be up to 255 characters long. To be portable, the file name should use only the characters in the POSIX portable file name character set:
  • Uppercase or lowercase A to Z
  • Numbers 0 to 9
  • Period (.)
  • Underscore (_)
  • Hyphen (-)
Do not include any nulls or slash characters in a file name.

The POSIX portable file name character set (see The POSIX portable file name character set) is a subset of the POSIX portable character set, which is listed in The POSIX portable character set.

The POSIX portable character set (see The POSIX portable character set) is a complete list of all valid characters for a file name.

Restriction: Double-byte characters are not supported in a file name and are treated as single-byte data. Using double-byte characters in a file name might cause problems. For instance, if you use a double-byte character in which one of the bytes is a . (dot) or / (slash), the file system treats this as a special delimiter in the path name.

The shells are case-sensitive, and distinguish characters as either uppercase or lowercase. Therefore, FILE1 is not the same as file1.

A file name can include a suffix, or extension, that indicates its file type. An extension consists of a period (.) and several characters. For example, files that are C code could have the extension .c, as in the file name dbmod3.c. Having groups of files with identical suffixes makes it easier to run commands against many files at once.