Jump to content

lfs – list your filesystems


aum

Recommended Posts

lfs-list-filesystems.png?resize=700,391&

 

The Command Line Interface (CLI) is a way of interacting with your computer. To harness all the power of Linux, it’s highly recommended mastering the interface. It’s true the CLI is often perceived as a barrier for users migrating to Linux, particularly if they’re grown up using GUI software exclusively. While Linux rarely forces anyone to use the CLI, some tasks are better suited to this method of interaction, offering inducements like superior scripting opportunities, remote access, and being far more frugal with a computer’s resources.

 

The part of the operating system responsible for managing files and directories is called the file system. It organizes our data into files, which hold information, and directories (also called ‘folders’), which hold files or other directories. We cover the basics of the file system in Linux for Starters – Part 12.

 

lfs is billed as a better df, a standard Unix command used to display the amount of available disk space for file systems on which the invoking user has appropriate read access.

 

Installation


There’s two main ways to install lfs. First, you can use cargo, Rust’s package manager. If you don’t have cargo installed, you’ll first need to type:

 

$ sudo apt install cargo

 

Now you can install lfs with the command:

 

$ cargo install lfs

 

One further step is that you’ll need to ensure ~/.cargo/bin is in your PATH. The variable $PATH is set by your shell every time it launches, but you can set it so that it always includes your new path with every new shell you open. The exact way to do this depends on which shell you’re running.

 

For the bash shell we follow these steps:

 

  • Open the .bashrc file in our home directory (~/.bashrc) in a text editor.

 

  • Add export PATH=”$PATH:~/.cargo/bin”to the last line of the file.

 

  • Save the .bashrc file.

 

  • Restart the terminal (or run the command source .bashrc).


Alternatively, you could copy lfs to a directory such as /usr/local/bin with the command:

 

$ sudo cp ~/.cargo/bin/lfs /usr/local/bin/

 

If you are neither a Rust developer nor an aspiring Rust developer, we suggest you install the precompiled lfs (which is very small) rather than install the Rust development environment. The developer provides binaries for x86-64, ARMv7, and AArch64 (the 64-bit extension of the ARM architecture, first introduced with the ARMv8-A architecture).

 

In Operation

 

Here’s an image showing lfs in operation. It actually shows two instances of the program, with the second command showing all mount points.

 

$ lfs and $ lfs -a

 

lfs.png

 

As the image shows, there’s a graphical representation for disk usage. That’s a useful visual improvement helping you to instantly know if a filesystem is running out of space.

 

The dsk column helps you determine the disk. There’s entries for SSD (solid state drive), HDD (mechanical hard disk drive), remov, RAM (an in-memory device), and crypt (a crypted disk).

 

The software has very few options. Besides showing the version, help, the only other option is the -j flag, which outputs in JSON, an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays.

 

All sizes are displayed using the current SI recommendations: 1M is one million bytes.

 

Summary


lfs is an improvement on the venerable df utility. We like the graphical bar showing how full each disk is.

 

Does lfs get our recommendation? On balance, not really. While it’s a useful utility the program lays out information poorly with some terminal emulators. It’s also got very few features.

 

If you’re looking for a modern replacement for df, we recommend duf instead. duf is highly recommended and is included in Outstanding Linux Utilities to Maximize your Productivity.

 

Website: github.com/Canop/lfs
Support:
Developer: Denys Séguret
License: MIT License

 

lfs is written in Rust. 

 

Source

  • Like 2
Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...