Operation Manual

tux@knox:~> ls
bin Desktop Documents public_html tux.txt
tux@knox:~>
Files in Linux may have a le extension or a sufx, such as .txt, but do not need to
have one. This makes it difcult to differentiate between les and folders in this output
of the ls. By default, the colors in the Bash shell give you a hint: directories are usually
shown in blue, les in black.
21.2.2 Using Commands with Options
A better way to get more details about the contents of a directory is using the ls com-
mand with a string of options. Options modify the way a command works so that you
can get it to carry out specic tasks. Options are separated from the command with a
blank and are usually prexed with a hyphen. The ls -l command shows the contents
of the same directory in full detail (long listing format):
tux@knox:~> ls -l
drwxr-xr-x 1 tux users 48 2006-06-23 16:08 bin
drwx---r-- 1 tux users 53279 2006-06-21 13:16 Desktop
drwx------ 1 tux users 280 2006-06-23 16:08 Documents
drwxr-xr-x 1 tux users 70733 2006-06-21 09:35 public_html
-rw-r--r-- 1 tux users 47896 2006-06-21 09:46 tux.txt
tux@knox:~>
This output shows the following information about each object:
drwxr-xr-x 1 tux users 48 2006-06-23 16:08 bin
Type of object and access permissions. For further information, refer to Sec-
tion 21.5.1, “Permissions for User, Group and Others” (page 311).
Number of hard links to this le.
Owner of the le or directory. For further information, refer to Section 21.5.1,
“Permissions for User, Group and Others” (page 311).
Group assigned to the le or directory. For further information, refer to Sec-
tion 21.5.1, “Permissions for User, Group and Others” (page 311).
File size in bytes.
Date and time of the last change.
Name of the object.
302 Reference