O'Reilly logo

Practical Linux by Bill Ball, John Ray, Michael Turner, M. Drew Streib

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Listing Directories

Listing the contents of directories, like navigating through your system, is a basic skill you should quickly master. The following sections describe several directory listing programs that are usually included with most Linux distributions.

Listing Directories and Files with the ls Command

Use the ls (list directory) command to list the contents of one or several directories. This command has more than 40 different command-line options that can be combined to format listings. Wildcards can be used to specify certain files or directories. To list the contents of the /usr/local/ directory, type the following:

$ ls /usr/local/
bin      etc      info     lib      qt       src
doc      games    lesstif  man      sbin

By default, the ls command lists the contents of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required