Navigating the Linux File System (LFS)
Last updated
Last updated
Imagine Linux's File System (LFS) as the backbone of where all your computer's data is stored. Drawing inspiration from UNIX, one cool thing about Linux is that it treats almost everything – be it data, commands, shortcuts, or whatever – as items in the filesystems. Knowing where things are, and understanding how to get around the filesystem from the shell, are critical skills in Linux!
Now, all this data lives inside what we call directories, or "folders" as you probably know them if you are predominantly a Windows user. And these directories? They can house both files and other nested directories. Think of it as a family tree. To find a file or a directory, you can be all formal and use the full address, like /home/chris/myfile.txt
. Or, if you're already in /home/chris
, just saying myfile.txt
gets the job done.
Picture the Linux file layout as an upside-down tree. At the very top, we've got the daddy of all directories, the root, depicted as a simple slash /
. And nope, it's NOT the same as the root user... Dive deeper, and you've got its children: common directories like bin
, dev
, home
, and a few others. Each of these can have their own little set of subdirectories. So, if you ever sketch this out, you'd see a sprawling family tree, or hierarchy, starting with the root directory at the top:
Let's focus on one of the directories found just below the LFS root: the /home
directory.
Inside, there's a specific space for my user, named chris. The directory typically shares the same name as the user account. My space is well-organised. I have areas designated for Desktop items, Documents, Downloads, and several other folders.
Now, inside my Documents directory, there's a subdirectory named memos
, and within that, a file named memo1.doc
:
If I want to reference this file from anywhere in the system, I'd say it's located at /home/chris/Documents/memos/memo1.doc
- this is known as the absolute path as it is true no matter where within the file system I am currently working
However, if I were already navigating within /home/chris/
, I could shorten my reference to Documents/memos/memo1.doc
- this is known as a relative path because it is only true when considered in relation to my current working directory
There are several directories within Linux that are of interest, and it's worth getting familiar with them:
Directory | Description |
| Contains common Linux user commands, such as |
| Contains files representing access points to devices on your systems. These include terminal devices (tty), hard disks (hd or sd), RAM (ram), and CD-ROM(cd*). Users can access these devices directly through these device files; however, applications often hide the actual device names to end users |
| Contains administrative configuration files. Most of these files are plain-text files that, given the user has proper permission, can be edited with any text editor |
| Contains directories assigned to each regular user with a login account. The root user is an exception, using /root as their home directory (see below) |
| Provides a standard location for automounting devices (removable media in particular). If the medium has a volume name, that name is typically used as the mountpoint. For example, a USB drive with a volume name of myusb would be mounted on |
| Contains shared libraries needed by applications in |
| A common mount point for many devices before it was supplanted by the standard |
| A directory sometimes used to automount filesystems upon request |
| Directory structure available to store add-on application software |
| Contains information about system resources |
| Represents the root user’s home directory. The home directory for root does not reside beneath |
| Contains administrative commands and daemon processes |
| Contains parameters for such things as tuning block storage and managing cgroups |
| Contains temporary files used by applications |
| Contains user documentation, games, graphical files (X11), libraries (lib), and a variety of other commands and files that are not needed during the boot process. The In theory, |
| Contains directories of data used by various applications. In particular, this is where you would place files that you share as an FTP server ( The |