This is your command line on lsd
Command Line – lsd

© Lead Image © bluedarkat, 123RF.com
A revamp of ls, lsd offers color coding plus revised options relevant to the modern computer.
If you work at the command line, you probably use ls
[1] frequently to list directories and their contents. However, it is one of the oldest commands, and many of its options are no longer relevant to modern computer use. In fact, most people can get by with only a small sub-set of its available options. One of several new revamps, lsd
(LSDeluxe) [2] (Figure 1) attempts to modernize and simplify ls
by assuming a default color code and – apparently – by reducing the number of options and adding options of its own. However, since this is 0.2.21 release, it is hard to be sure exactly what the general release will look like.

The lsd
release page includes Linux packages for Debian and Gentoo. An alternative is to build from source with the Rust Cargo package manager or install a Snap package. Should you install from source, you will also need to install Nerd Fonts [3] in order to use fancy icons to identify file types.
On installation – or perhaps later, after you have tried lsd
and have a better sense of what it can do – you may also want to add a configuration file (Figure 2), copying and modifying the sample provided on the project page. This configuration file should be placed in ~/.config/lsd/config.yaml
. Table 1 lists the main fields available and their settings. Default configurations can be overridden from the command line but can reduce the length of entered commands.
Table 1
Selected Configuration Settings
Field | Description | Values | Default |
---|---|---|---|
|
Sets backward compatibility with |
|
|
|
Specifies the columns and their order |
|
|
|
When to colorize |
|
|
|
Date format for |
|
|
|
Whether to dereference symbolic links |
|
|
|
What items to display |
|
|
|
When to use icons |
|
|
|
Which icon theme to use |
|
|
|
How the icon is separated from the file name |
|
Single space |
|
Which layout to use |
|
|
|
Whether to enable recursion |
|
|
|
The recursion depth |
Any positive number |
|
|
The format of the |
|
|
|
Specify what to sort by |
|
|
|
Whether to reverse the sorting |
|
|
|
Whether to group directories and where |
|
|

Note that in the current release the set colors cannot be altered, although that may change in later releases. Figure 3 shows the default colors currently in use. Colors are only the most obvious ways that directories and files can be coded, the others being --icons
and --icon-themes
(Figure 4) and --classify
(-F
), which uses special characters (*, /, =, >, @, and |) to indicate file types. Probably, most users will want to use only one of these choices.


Options
The current ls
command has 58 options. By contrast, the current lsd
release has 25. More might be added before the general release, but lsd
is already a functional match for ls
and broadly backwardly compatible with it, with much of the same structural logic. However, some of the ls
options are less relevant than they once were. For instance, today only a few applications like Bluefish use ~
to indicate a backup file, so the ls
option --ignore-backups
(-B
) is unlikely to be missed. Similarly, the decline of Emac's popularity means that the --dired
(-D
) option to generate output for Emac's Dired mode seems no longer necessary or at least a low priority to implement. Nor does lsd
require the -C
option for displaying in columns – because it does so by default and other options such as tree or single-line displays are folded into the same command. The overall result is that lsd
is easier to learn than ls
, especially when more than basic options are used.
So what options are left? First, the options that can be placed in a configuration file (Figure 2). They take the same possible values as in the configuration file and override the file as well. Another set of options are those found in ls
. In particular, --all
(-a
) displays dot
files, and --nosymlink
does not display symbolic links, while -directly-only
(-d
) lists only directories. The same sorting options are also used: --recursive
(-r
), --reverse
(-r
), --sizesort
(-s
), and --timesort
(-t
), all of which are self-explanatory. Other options include --total-size
, which displays the total size of directories, and --oneline
(-1
) and --tree
, which offer alternative displays (Figure 5 and 6). And if you have no wish for color or icon coding, you can use --classic
to suppress them. If you are proficient with ls
, many of these options will be familiar.


Naturally, which options you require depends on your current tasks, but you are likely to develop preferences in layout. When you do, consider creating an alias for lsd
so that you have no need to break the habit of typing ls
. To give the simplest alias, in your ~/.bashrc
file or its equivalent, add the line:
<C>alias ls='lsd'<C>
You may want to set other aliases for lsd
, each with its own set of options.
Other ls Updates
In addition to lsd
, at least five more revisions of ls
are competing for the same niche: exa
, colorls
, ls++
, ls-go
, and k
. Many of these are released under an MIT license, and most focus on a color display. However, lsd
is an ideal place to begin exploring the new alternatives. Backwards compatibility makes it an obvious replacement for ls
. While various forms of file coding may be too complex for some users, lsd
offers several choices. However, if lsd
is not for you, you have others to fall back on. Obviously, the time has come to revamp one of Linux's most basic commands.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.
News
-
Arch Linux 2023.12.01 Released with a Much-Improved Installer
If you've ever wanted to install Arch Linux, now is your time. With the latest release, the archinstall script vastly simplifies the process.
-
Zorin OS 17 Beta Available for Testing
The upcoming version of Zorin OS includes plenty of improvements to take your PC to a whole new level of user-friendliness.
-
Red Hat Migrates RHEL from Xorg to Wayland
If you've been wondering when Xorg will finally be a thing of the past, wonder no more, as Red Hat has made it clear.
-
PipeWire 1.0 Officially Released
PipeWire was created to take the place of the oft-troubled PulseAudio and has finally reached the 1.0 status as a major update with plenty of improvements and the usual bug fixes.
-
Rocky Linux 9.3 Available for Download
The latest version of the RHEL alternative is now available and brings back cloud and container images for ppc64le along with plenty of new features and fixes.
-
Ubuntu Budgie Shifts How to Tackle Wayland
Ubuntu Budgie has yet to make the switch to Wayland but with a change in approaches, they're finally on track to making it happen.
-
TUXEDO's New Ultraportable Linux Workstation Released
The TUXEDO Pulse 14 blends portability with power, thanks to the AMD Ryzen 7 7840HS CPU.
-
AlmaLinux Will No Longer Be "Just Another RHEL Clone"
With the release of AlmaLinux 9.3, the distribution will be built entirely from upstream sources.
-
elementary OS 8 Has a Big Surprise in Store
When elementary OS 8 finally arrives, it will not only be based on Ubuntu 24.04 but it will also default to Wayland for better performance and security.
-
OpenELA Releases Enterprise Linux Source Code
With Red Hat restricting the source for RHEL, it was only a matter of time before those who depended on that source struck out on their own.