O'Reilly logo

Practical UNIX by Steve Moritsugu - DTR Business Systems

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 Files

You can use the ls command to list the filenames in either the current directory or a different directory. The following is the general syntax:

ls options arg1 arg2 ...

Here, options may be -l (as you saw earlier) or many other options, as described in later sections. arg1 arg2 are file or directory names to be listed.

If a directory is given, then the contents of the directory will be shown (unless the -d option is present). If no arguments are given, the contents of the current directory will be shown.

See Table 7.3 for other standard properties of the ls command.

Table 7.3. Other Properties of the ls Command
PropertySee page
Allows relative and absolute pathname arguments70
Allows a list of filenames and filename wildcards292
Allows ...

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