Get the highlights in your inbox every week.
Use the Linux terminal to see what files are on your computer | Opensource.com
Use the Linux terminal to see what files are on your computer
Learn how to use the ls command to list files in the terminal with this Linux tutorial.
To list files on a computer with a graphical interface, you usually open a file manager (Files on Linux, Finder on MacOS, Windows Explorer on Windows), and look at the files.
To list files in a terminal, you use the ls command to list all files in the current directory. The pwd commands tells you what directory you're currently in.
You can view hidden files with the --all option:
$ ls --all
As you can see, the first items listed are dots. The single dot is actually a meta location meaning the folder you are currently in. The two dots indicate that you can move back from this location. That is, you are in a folder in another folder. Once you start moving around within your computer, you can use that information to create shortcuts for yourself or to increase the specificity of your paths.
Files and folders and how to tell the difference
You may notice that it's hard to tell a file from a folder. Some Linux distributions have some nice colors set up so that all folders are blue and the files are white and binary files are pink or green, and so on. If you don't see those colors, you can try ls --color. If you're color blind or on a display that doesn't provide colors, you can alternately use the --classify option:
$ ls --classify
As you can see, folders are given a trailing slash (
/) to denote that they are steps within your file system. Binary entities, like zip files and executable programs, are indicated swith an asterisk (