Examining Files from the Command Line

To use the command line, open a terminal window. You see the home directory of the account you are using. To see a listing of the files in the directory, use the ls command, as follows:

					ls
Desktop      Images       test.txt

The output shown just lists the names. Some distributions output color-coded listings to show the type of files, such as blue for directories. Others show a forward slash (/) after the names of directories, as shown in the following output:

					ls
Desktop/     Images/     test.txt

To see more information about the files, use the options of the ls command. All the options are documented in the man page for ls, accessed by typing:

man ls

One useful option is -l to get a long listing, as follows:

					ls -l

Get Spring Into Linux® 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.