Quick Start Guide

Also keep this in mind for commands to delete objects. Before entering a command
like rm (without any option) for removing a le, you should know if you really want
to get rid of the object: it will be deleted irretrievably, without conrmation.
7.2.1 Using Commands without Options
In Section 6.3.1, “Permissions for User, Group and Others” (page 82) you already
got to know one of the most basic commands: ls, which used to list the contents of
a directory. This command can be used with or without options. Entering the plain
ls command shows the contents of the current directory:
tux@knox:~> ls
bin Desktop Documents public_html tux.txt
tux@knox:~>
As you already learned in Section 6.2.1, “Key Features” (page 75) les in Linux may
have a le extension or a sux, such as .txt, but do not need to have one. This
makes it dicult to dierentiate 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.
7.2.2 Using Commands with Options
A better way to get more details about the contents of a directory is using the ls
command 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 6.3.1, “Permissions for User, Group and Others” (page 82).
Number of hard links to this le.
Owner of the le or directory. For further information, refer to Section 6.3.1,
“Permissions for User, Group and Others” (page 82).
Group assigned to the le or directory. For further information, refer to Sec-
tion 6.3.1, “Permissions for User, Group and Others” (page 82).
Shell Basics 87