PC filenames are usually 8 characters, a period, then 3 characters (Windows 95/98, a bit longer). Macintosh filenames can be a maximum of 31 characters and directory names can be 28 characters in length. UNIX filenames can be very long, up to 255 characters in length.
It is best to keep the file names short because you still have to type the characters in most cases.
Filenames, like UNIX commands are Case Sensitive. UPPER CASE filenames are different from lower case file names.
Also, it is best if you do not use the following characters in a UNIX file name
*&%$|^/\~
or - as the first character of a file name.
Because those characters are interpreted by UNIX as commands.
You can use spaces in UNIX file names, but it is not recommended since you will then have to surround the file name with quotes whenever you want to use that name. For example, if you want to refer to the file Program #2, you would have to write "Program #2", otherwise UNIX will try to interpret the #2 part as a command or the name of another file.
Still, UNIX file naming will allow you to name files in a descriptive method so you can always determine what the file is from its name. It is often useful to have a personal strategy for naming files. This way, you can easily look at a group of file names and understand a lot about the files.
For example, here is one strategy for naming files
|
File Ending |
What it Means |
|
|
A GCG DNA sequence file |
|
|
A peptide/protein sequence |
|
|
A 3-D Molecular Coordinate File |
|
|
The results from the GCG Map program |
|
|
the results from a FASTA search |
Using this strategy, you can easily look through a bunch of files and see which one is the DNA sequence, which one is the protein sequence, etc...
trypsin.seq trypsin.pep trypsin.pdb trypsin.fasta
It doesn't matter what naming strategy you use, just as long as it is consistent.
Other popular methods of naming files include
|
What to Type |
What it Does |
|
|
the file, file2_text in the current directory |
|
|
the file, "file2 text" in the /tmp directory |
|
|
the file, file2.txt, up one directory level |
|
|
the file, file2.txt, in the home directory of user "smith" |
For more help with the cd command or to see the online UNIX manual and all the extensions to the cd command, click here.