View Directory Contents With Ls - Red Hat ENTERPRISE LINUX 3 - STEP BY STEP GUIDE Manual

Table of Contents

Advertisement

Chapter 3. Shell Prompt Basics
As soon as you give the root password, the prompt changes to superuser status. For example:
[root@localhost root]$
When you are done working as root, type

3.5. View Directory Contents with ls

Now that you know how to change directories, it is time to learn how to view the contents of these
directories. Using the
Many options are available with the
files in the directory. Some files are hidden files (also called dot files) and can only be seen with an
additional option specified to the
Tip
To view all
command options, read the man page by typing
ls
man page, at the prompt type
Type the command
ls -a
Figure 3-3.
with the
ls
Hidden files are most often configuration files which set preferences in programs, window managers,
shells, and more. The reason they are hidden is to help prevent any accidental tampering by the user.
When you are searching for something in a directory, you are not usually looking for these configu-
ration files. Keeping them hidden helps to avoid some screen clutter when viewing directories at the
shell prompt.
Viewing all the files using the
more information by using multiple options.
If you want to see the size of a file or directory, when it was created, and so on, add the long option (
to the
command. This command shows the file creation date, its size, ownership, permissions,
ls -a
and more.
exit
command, you can display the contents of your current directory.
ls
command. The
ls
command.
ls
man ls | col -b | lpr
. Now you can view files that begin with dots.
Option
-a
command can give you plenty of detail, but you can view still
ls -a
at the prompt; you are returned to your user account.
command, by itself, does not show all the
ls
man ls
.
at a shell prompt. To print the
29
)
-l

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 3

Table of Contents