lfs: List the Linux File System in a Convenient Way

lfs is a small tool similar to the df command for producing a list of file systems on Linux in a clear and beautiful tabular form.

You sometimes need to work with disks or partitions directly from the command line on Linux. Often, you want to perform actions on the filesystems, but you do so by specifying the partitions where they are stored.

Many tools are available to find the list of currently available filesystems in Linux, the most commonly used of which is df. Unfortunately, on systems with many disks, partitions, and USB drives, it can be hard to identify the device name assigned to each of them. And this is where lfs comes on the scene. 

The lfs command is used to show the amount of free disk space available on Linux and other Unix-like systems and to understand the filesystems that have been mounted. All this is shown in a clear and beautiful tabular form.

Using the lfs command is more than easy. All you need to do is to type lfs in your terminal:

lfs
List Linux File Systems by Using the lfs Command

By default, lfs only lists the filesystems backed by block devices looking like real disks. You can see the other ones with the -a option.

lfs -a
List Linux File Systems by Using the lfs Command

As you can see, most information given by the lfs command is already provided by df. However, there are some improvements worth mentioning:

  • Helps you recognize your disks by labeling them rem (removable), HDD, or SSD.
  • lfs only uses SI (The International System of Units), so you don’t have to open the help and check the right argument for the correct size units.
  • Displays the type of filesystem.
  • Sorts filesystems by size.

For detailed information, you can refer to the projectโ€™s page.

How to Install lfs on Linux

You can download the precompiled binary from the project’s GitHub releases page.

wget https://github.com/Canop/lfs/releases/download/v2.6.0/lfs_2.6.0.zipCode language: JavaScript (javascript)

Extract the zip file using the following command:

unzip lfs_2.6.0.zipCode language: CSS (css)

Next, you’ll have to ensure that the shell can find the lfs executable. An easy solution is to put it in /usr/local/bin and to set it as executable:

sudo mv build/x86_64-linux/lfs /usr/local/bin/
sudo chmod +x /usr/local/bin/lfs

Thatโ€™s all. The lfs command should now be available on your system.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Think You're an Ubuntu Expert? Let's Find Out!

Put your knowledge to the test in our lightning-fast Ubuntu quiz!
Ten questions to challenge yourself to see if you're a Linux legend or just a penguin in the making.

1 / 10

Ubuntu is an ancient African word that means:

2 / 10

Who is the Ubuntu's founder?

3 / 10

What year was the first official Ubuntu release?

4 / 10

What does the Ubuntu logo symbolize?

5 / 10

What package format does Ubuntu use for installing software?

6 / 10

When are Ubuntu's LTS versions released?

7 / 10

What is Unity?

8 / 10

What are Ubuntu versions named after?

9 / 10

What's Ubuntu Core?

10 / 10

Which Ubuntu version is Snap introduced?

The average score is 68%