= 5 great Rust tools for the Linux terminal

Linux inherited a lot from Unix, and Unix has been around for half a century.
That means most of the tools you use in your Linux terminal are probably either have a very lorg history, or were written to emulate those historical commands.
It's a point of pride inn the POSIX world that tools don't _need_ constant reinvention.
In fact, there's a subset of Linux users today who could run a https://opensource.com/article/16/12/yearbook-linux-test-driving-distros[version of Linux from before they were born] without having to learn anything new.
It's tried, true, and reliable.

That doesn't mean there hasn't been evolution, though.
All the commands Linux users know and love have improved over the years.
Some have even been replaced entirely, and are so common today that few people still care to remember the old ones.
Can you imagine Linux without SSH?
Well, believe it or not, SSH replaced a command called `rsh`.

I'm often on the look out for new commands, because I'm always intrigued by the possibility of getting things done more efficiently.
If there's a better, faster, or more robust command out there for a common task, I want to know about it.
And while there's equal opportunity for any language to invent new Linux commands, Rust developers have been delivering an impressive collection of useful general-purpose utilities.

== Replace man with tealdeer

Tealdeer provides the `tldr` command, which displays an abbreviated no-nonsense summary of how a command is used.
It's not that manual and info pages aren't useful, because they are, but sometimes they can be a little verbose and a little obtuse.
Tealdeer keeps its hints clear and concise, with examples of how to use the command you're struggling to recall.

[source,bash]
----
$ tldr tar

 Archiving utility.
 Often combined with a compression method, such as gzip or bzip2.
 More information: <https://www.gnu.org/software/tar>.

 [c]reate an archive and write it to a [f]ile:

     tar cf target.tar file1 file2 file3

 [c]reate a g[z]ipped archive and write it to a [f]ile:

     tar czf target.tar.gz file1 file2 file3

 [c]reate a g[z]ipped archive from a directory using relative paths:

     tar czf target.tar.gz --directory=path/to/directory .
[...]
----

https://opensource.com/article/21/6/tealdeer[Read the full article on `tldr`].

== Replace du with dust

The `du` command gives you feedback about disk usage.
It's a relatively simple task, and likewise the command is pretty simple, too.
The `dust` command is `du` written in Rust, and it uses color-coding and bar graphs for users who prefer added visual context.

[source,bash]
----
$ dust
5.7M   ┌── exa                                   │                                   ██ │   2%
5.9M   ├── tokei                                 │                                   ██ │   2%
6.1M   ├── dust                                  │                                   ██ │   2%
6.2M   ├── tldr                                  │                                   ██ │   2%
9.4M   ├── fd                                    │                                   ██ │   4%
2.9M   │ ┌── exa                                 │                                 ░░░█ │   1%
 15M   │ ├── rustdoc                             │                                 ░███ │   6%
 18M   ├─┴ bin                                   │                                 ████ │   7%
 27M   ├── rg                                    │                               ██████ │  11%
1.3M   │     ┌── libz-sys-1.1.3.crate            │  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │   0%
1.4M   │     ├── libgit2-sys-0.12.19+1.1.0.crate │  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │   1%
4.5M   │   ┌─┴ github.com-1ecc6299db9ec823       │  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │   2%
4.5M   │ ┌─┴ cache                               │  ░░░░░░░░░░░░░░░░░░░░░░░░
[...]
----

https://opensource.com/article/21/6/dust[Read the full article on `dust`].

== Replace find with fd

The `find` command is a useful tool for finding files on your computer, but its syntax can be difficult to master.
Not only are there a lot of options, but the order of those options can be significant, depending on what you're doing.
Some people https://opensource.com/article/20/2/find-file-script[have written scripts] to abstract the task away from the command.
Other people just write a new tool altogether, like `fd`.

Syntax doesn't get any easier than this:

[source,bash]
----
$ fd example
Documents/example.txt
Documents/example-java
Downloads/example.com/index.html
----

https://opensource.com/article/21/6/fd[Read the full article on `fd`].

== Replace ls with exa

You might not think that `ls` would have much room for improvement.
But `exa` proves that even the most mundane unitily can benefit from small adjustments.
For instance, why not have an list command with built-in Git awareness?
Why not get extra metadata in your file lists?

https://opensource.com/article/21/3/replace-ls-exa[Read the full article on `exa`].

== Tokei

Unlike the other tools on this list, the `tokei` utility doesn't replace one command, but it does demonstrate how the Linux terminal is, as always, an environment very much in constant growth.
New commands

[[ NOTE: Sudeshna write about why/how she uses tokei. ]]

[source,bash]
----
$ tokei ~/exa/src ~/Work/wildfly/jaxrs
==================
Language   Files Lines Code Comments Blank
Java        46    6135  4324  945     632
XML         23    5211  4839  473     224
---------------------------------
Rust
Markdown
-----------------------------------
Total
----

https://opensource.com/article/21/6/tokei[Read the full article on `tokei`].

== Find your favorite

As open source users, we never have to settle for just a small set of commands, or even just one version of a command.