next up previous
Next: MovingCopying and Removing Up: USING UNIX Previous: Ways to Refer to

Listing the Contents of a Directory (ls)

The function ls gives a list of the names of the files in a directory. It can also be used to give the names of certain types of files. It has many options. Here are some examples.

List all files in the current directory:
ls
List all files that end in .tex:
ls *.tex
List all files including hidden ones that start with a dot:
ls -a
Give the sizes of files in kilobytes:
ls -s
Give the long form with permissions and modification date:
ls -l