Introduction to Linux Systems Administration
File Listings, Ownerships, and Permissions
Managing files under Linux is different from managing files under Windows. This
section discusses the tools necessary to perform basic file management.
ls: List Files
The ls command is used to list all of the files in a directory. The command has more
than 26 options. The most common of these options are shown in Table 21-2. See the
man page for the complete list of options.
You can use these options in any combination with one another. For example, to list
all files in a directory with a long listing, type the following:
[root@ford /root]# ls -la
To list nonhidden files in a directory that start with A, type the following:
[root@ford /root]# ls A*
About Files and Directories
Under Linux (and UNIX in general), you will find that almost everything is abstracted
to a file. Linux's developers originally did this to simplify the programmer's job. Thus,
instead of having to communicate directly with device drivers, you use special files
(which to the application appear as ordinary files) as a bridge instead. To accommodate
all of these uses of files, different types of files exist:
Normal files are just that--normal. They contain data or
executables, and the operating system makes no assumptions about their
Long listing. In addition to the filename, show the file size,
date/time, permissions, ownership, and group information.
All files. Show all files in the directory, including those that are
hidden. Hidden files begin with a period.
Single column listing. List all files in a single column.
Recursive. Recursively list all files and subdirectories.
Common ls Command Options