Listing the Contents of a Directory with ls

The ls command lists the contents of the current directory. It is commonly used by itself, but a number of options (also known as switches) are available for ls and give you more information. If you have just logged in as described earlier, this command lists the files and directories in your user’s home directory:

matthew@seymour:~$ lsDocuments    Music      file.txt  Pictures  Music


All directory listings in this chapter are abbreviated to save space.

By itself, the ls command shows just a list of names. Some are files, some are directories. This is useful if I know what I am looking for but cannot remember the exact name. However, using ls in this matter has ...

Get Ubuntu Unleashed 2014 Edition: Covering 13.10 and 14.04,Ninth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.