ls - List Directory
Quite often you will want to look at the contents of your directories to see what files you have. You might want to see how large those files are, or when they were created. You might also want to see what files and directories are located in other directories. The command that allows you to do this is the ls (list directory) command.
Syntax
eos% ls pathname
ls also accepts the following dash options:
| -l | lists the contents in long format (all information, size, date, owner, etc.) |
| -a | lists ALL files, even "." (dot) files |
| -al | lists ALL files in long format |
Example 1
If your current working directory was your home directory, how would you list the contents of your home directory?
|
|
Ask yourself:
|
Example 2
If your current working directory was your home directory, how would you list all the contents of your home directory, including dot files?
|
|
Ask yourself:
|
Example 3
If your current working directory was your home directory, how would you list the contents of your home directory?
|
|
Ask yourself:
Notice in the listing below that the dot files are not shown. This is because you did not use the |








