|
||
Lesson 2
Objective
|
More options for listing files
List files using the ls command. |
|
|
You already should be familiar with two of the
ls commands more useful options:
Listing hidden files
Listing a directory tree
Directories often contain other directories, which in turn can contain their own subdirectories, and so on down
the file hierarchy. UNIX lets you display a directory tree all at once by using the ls -R command. The
-R option produces a recursive listing .
recursive listing:
A recursive listing of a directory is one that repeatedly displays all subdirectories down the hierarchy,
until the last level of the directory tree is reached.
Listing a directory name
That is, ls descends each subdirectory, listing the contents until the bottom of the hierarchy is reached.
Normally, when you specify a directory name with ls, you see the contents of the directory.
But if you want to display the directory itself, use the -d option. The following Slide Show shows how to use the -a, -R, and -d options. In the next lesson, copying directories by using the -r option of the cp command will be discussed. |
||
|
|
||