The ls command gives a listing of the contents of a directory
The ls command produces an output like this
A description of this output can be found on the next page.
Most UNIX commands have a variety of additional command modifiers that can be used to change the output.
For example, if you typed
ls -l
you would get a long listing of the directory contents that looked like this
Other popular ls commands include
| What to Type | What it Does |
ls -a | list all files, including the hidden ones |
ls -g | list which group owns the files |
ls -lag | list everything |
ls *.txt | list only files with a .txt on the end |
ls data* | list only files that start with the word "data" |
For more help with the ls command or to see the online UNIX manual and all the extensions to the ls command, click here.