Whether you are beginning to learn the ins and outs of the Linux operating system (OS) or have been using Linux for years, it is important to know how to navigate the file system of your device. Of course, many different Linux OSes have graphical user interfaces (GUIs), but they also provide the option to use a command line interface (CLI). A GUI is what many modern-day devices provide for users that, as the name implies, uses graphics and visuals to help a user utilize the system. For example, you can move your mouse cursor across the screen, click on an icon, and open a file or start an application. With a CLI, however, everything is condensed down to typing in text commands in a prompt window. Thus, to navigate around your device using the command line, you need to know the right commands to use; in some cases, knowing the right commands to type can be faster than moving and clicking the mouse around the screen.
A Brief Definition of a File System
Before getting into the commands themselves, it is important to know what a file system is and how the Linux file system is usually structured. A file system, as defined by the National Institute of Standards & Technology (NIST), is “a software mechanism that defines the way that files are named, stored, organized, and accessed on logical volumes of partitioned memory”. Simply put, it is the way in which the operating system of your device handles your files. In many cases, the file system is set up like a hierarchy, which folders and files being inside of other folders. As a result, there is usually a “root” folder that contains the majority of the files and applications users would normally access when using their device.
When discussing the Linux file system, folders are referred to as “directories”, and this terminology will be used through the rest of this guide.
Linux File System Commands
Displaying the Current Directory
Before changing which directory you are in, it is important to figure out where, exactly, you are in the file system. The command “pwd”, which stands for “print working directory”, will display the filepath of the current directory you are viewing to the command line.
Simply type
pwd
into your command line, and press enter. This will display the directory you are currently in, which may look something like “/users/johndoe”. This directory will likely be your home directory.
When you are in a directory, you will likely want to know what directories and files are inside of it. This is where the “ls” command comes in, which stands for “list”. This command will list out most of the files and directories inside your current directory.
Simply type
ls
into your command line and press enter. This will display a list of the various files and directories inside your current directory to the command line, but will only show the names of these files and directories. If you want to view additional information about these files and directories, you will want to type
ls -l
into your command line and press enter. The “-l” tells the computer to display extra information about each item, including whether it is a directory or file (if it is a directory, it will have a letter “d” at the beginning of the line, and if it is a file, this first symbol will be a “-” instead), the permissions that are available for each file, the date the file was last modified, and so on. For the purposes of this tutorial, we only need to know whether an item is a directory or not.
Moving to Other Directories
Next, to change which directory you are in, you use the “cd” command, which stands for “change directory”. Just typing “cd” by itself, however, will not do much; you need to specify where you want to move to by including the name of the directory with your command or by using one of a few special symbols.
For example, say our current directory is “/users/johndoe” and we want to navigate to the Documents directory. If the Documents directory is inside of the johndoe directory, we can simply type
cd Documents
into the command line. Alternatively, we can specify the full filepath:
cd /users/johndoe/Documents
A third option uses one of the special symbols, “.”. This symbol represents the current directory that you are viewing. Thus, typing
cd ./Documents
will also take us to the Documents folder.
If we do a “pwd” command, it will now print our new directory to the command line, and doing an “ls” command will show the files and directories in this new directory. Now say we wanted to move to the Taxes directory inside of the Documents directory. We can simply use one of the above methods to do so. This will put us in /users/johndoe/Documents/Taxes.
Now, say we wanted to go back to the Documents folder. Instead of typing “cd /users/johndoe/Documents”, we can instead use another special Linux symbol, “..”. This symbol represents whichever directory has our current one inside of it. For example, the Taxes directory is inside of the Documents directory. So,
cd ..
takes us back to /users/johndoe/Documents. We can use “..” together with slashes to go back (or out) as far as we want. For example, say we were in /users/johndoe/Documents/Taxes/2025 and we wanted to get back to /users/johndoe/Documents. We could do
cd ../..
which will take us back (or out) two directories.
Finally, there are two other symbols that represent two specific directories. The first is “~”, which represents our home directory. If we were in /users/johndoe/Documents/Taxes/2025 and wanted to get back to /users/johndoe, we could do
cd ~
and this will take us back. The other special symbol is a single “/”, which represents the root directory. This directory is, as the name implies, the directory at the “root” or start of the file system and holds most, if not all, other files.
cd /
will take us to the root directory.
While these commands may seem confusing at first, they get easier and become second nature with time. They can be especially useful to quickly navigate around the file system, especially when there are many directories to go through.
Linux Command Dictionary
pwd
will print the current directory to the command line. Stands for “Print working directory”.
ls
will list the files and directories that are in the current directory. Stands for “list”.
ls -l
will list the files and directories that are in the current directory with some additional file information.
cd
will change the current directory to the one specified. Stands for “change directory”.
.
represents the current directory.
..
represents the directory that is a step back (or out) from the current directory.
~
represents the home directory, which is the default directory that most users start in.
/
represents the root directory, which is the topmost directory in the filesystem.
Resources & Further Reading
NIST. “File System – Glossary | CSRC.” Csrc.nist.gov, National Institute of Standards & Technology, csrc.nist.gov/glossary/term/file_system.





Leave a comment