As you have probably noticed, it can be difficult to determine whether
something is a file or a directory when you use the ls
command. To display the difference between files and directories, you
can add an option to the ls command
so that it will display a long listing. By looking
at the long listing, you will easily be able to tell if an entry is
a file or a directory.
Command options are entered after the command name and are preceded
with a - (dash). One space separates the command name
and the dash.
The option that you will add to the ls
command to get a long listing of your directory is represented by the
letter l (lowercase L). To enter the ls
command with the long listing option, enter this at the command line:
ls –l
Notice that the l option is preceded
with a - (dash) and that one space separates the ls command
from the dash.
The long listing will give you more detailed information
about each file or directory. Each file or directory appears on its own
line. The name of the file or directory is shown at the end of its line.
The first character of each line indicates whether that entry is a file
or a directory. If the entry is a directory, the letter "d"
will be the first character in the line. If the entry is a file, a dash
will be the first character in the line.
|