Does Your Terminal Spark Joy?
Published: 2020-06-13 01:16:11

---
title: Does Your Terminal Spark Joy?
published: true
date: 2020-05-21 04:19:27 UTC
tags: 
canonical_url: 
---

While the list of development tools we have to choose from grows every day, thehumble unix terminal beckons us with simplicity and the promise of adistraction-free experience. Once you’ve conquered the initial learning curveof navigating a command-line interface, you may be craving some sugary featuresyou gave up ditching IDEs (Integrated Development Environments). Surely theremust be some middle ground between a lone blinking cursor and clunky GUIs(Graphical User Interfaces)!

Read ahead for some helpful _reimagininings_ of classic Unix tools.

## 1. man & tldr

First I’d like to share the [**tldr**](https://tldr.sh/) command, which provides a “just get me upand running” familiarity with many unix commands. Inspired by the **man** command to read manual pages for a program, tldr is much more concise and showscommon one-line examples of how a program is used. Yes, you should still readthe man page, but this can save you some time.

Compare the results below for Hugo, a static site generator:

```
$ man hugo

```

![man](https://symkowick.org/images/man-hugo.gif)

lots of info there…could be a while!

```
$ tldr hugo

```

There we go! Immediately I know how the developer of hugo intends me to use it -just type **hugo new site** in any directory I’d like to create my website.

![tldr](https://symkowick.org/images/tldr-hugo.gif)

## 2. Cat -> Bat

The [**Cat**](http://man7.org/linux/man-pages/man1/cat.1.html) command is pretty muchunavoidable when working with the terminal - it allows concatenation of files(and printing them to standard output) and is the most common way to simplyspit out the contents of a file!

If I wanted to see the contents of a JavaScript file, I would simply:

```
$ cat example.js

```

and we would get the contents of the file, simply and without fanfare:

![cat](https://symkowick.org/images/cat.gif)

This is great, but the [**bat**](https://github.com/sharkdp/bat) command improvesreadability of code by adding line numbers and syntax highlighting, all withoutsacrificing POSIX compatibility for piping into other programs.

```
$ batcat example.js

```

![bat](https://symkowick.org/images/bat.gif)

Awesome! It even opens in a pager (like the _less_ command) for verticalscrolling. If you want this functionality by using the same keyword - cat - youcan set up an alias in your shell. I use [zsh](http://www.zsh.org/), and havealiased bat as follows:

```
alias cat="batcat -n --color auto --style full"

```

## 3. du -> dust

The _du_ command shows disk usage and can be used to determine whichdirectories are taking up the most space - useful when you’ve run out of saidspace!

```
$ du

```

![du](https://symkowick.org/images/du.gif)

er, ok, looks like we are listing folders and files with numbers prepended totheir entries. Hmm. You can see that it’s gonna take some grokking to make sense of thisdata.

Let’s try the rust replacement, [**dust**](https://github.com/bootandy/dust) - like du but more intuitive, (straight from thetool website)!

```
$ dust

```

![dust](https://symkowick.org/images/dust.gif)

Wow, right away we are given a hierarchical view of the items within theDownloads folder - accompanied by a graph of size by percentage - or how much ofthe total folder size each subfolder is responsible for. Neat! Looks like thatrecent free dump of [Springer Textbooks](https://www.springer.com/us) is takingup 68%! Do I really need _all_ those books??

Dust is great for finding size of files, but how about our primary interfacefor dealing with files and directories in the shell?

## 3. ls -> exa

ls is the simple “show me what you got” program to list all items in adirectory. It has some helpful options to enable showing hidden/dot files, filesizes, permissions, and more. The below example will show off listing all(including hidden) files in the **-l** long format to get those other items Imentioned.

```
$ ls -la --color

```

![ls](https://symkowick.org/images/ls.gif)

This looks all right, and **ls** is pretty configurable as far as output formats.However, with [**exa**](https://the.exa.website/) we get some enhanced color andsane defaults.

```
$ exa -la

```

![exa](https://symkowick.org/images/exa.gif)

See how the permissions and owners are also color-coordinated? Nice. The exawebsite also notes that exa runs in parallel, so you might see much fasterperformance working in huge directories.

Those are just a few handy tools I’ve been exposed to recently that I thinkmight help you. The year is 2020, and we can live in whatever time we want -a splash of 1970 with [Cool RetroTerm](https://github.com/Swordfish90/cool-retro-term) mixed with powerful 2020tools! If you enjoyed this post, please let me know, and if you have anyquestions or noticed a mistake, feel free to reach out! If you read throughthis blog post and thought, man, I’ve already known about these for years and Ibreezed through this refresher, kudos to you, friend! But I’ve got somethingfor you too - check out [Nushell](https://www.nushell.sh/), it fits the themeof this blog post but expands it to the whole shell itself. Nushell toutscomposable tables as the primary method of interaction as opposed to totallyunstructured text.