Linux Fu: Modernize Your Command Line

If you use Linux and its associated tools on the desktop or on a Raspberry Pi, or on a server, you probably have used the command line. Some people love it and some people hate it. However, many of us have been using Linux for years and sometimes Unix before that, and we tend to use the same old tried-and-true tools. [Remy Sharp] had a recent post talking about how he had created aliases to replace those old tools with great modern replacements and it is definitely worth a read.

We’ll be honest, when we first saw the post we almost skipped reading it. A lot of Linux tip posts are pretty uninteresting unless you are a total beginner. But [Remy] has a lot of really great tools and how he has them installed including bat, which is like cat but with syntax coloring (see picture above), and fzf — a command line history search on steroids. He even shows how to join fzf and bat to make a very cool file browser from the command line (see below).

That’s not all of the replacements, either. He had htop of course, which we’ve used for a long time. There are some nicer replacements for htop, like glance. There was also prettyping (that is pretty ping, not pret typing) which is a nice alternative to ping. We were less convinced of the need to replace find and grep because we are pretty happy with them and we have our own favorite replacement for diff which does launch a GUI, so we didn’t try those.

You might not like all the choices on the list — we didn’t. But that’s the nice thing about Linux. You can use what you want, more or less. Which is another of our favorite aliases, replacing more with less. We also like cdfunc and fasd and we manage all that madness using a system for putting .bash.rc under git control. That also keeps it synchronized between machines.

If you like tools to help run your system, we talked about a few before. If you don’t care for [Remy’s] choice of tldr instead of man, you might like our take on help for Bash. Of course, if you don’t mind abandoning bash, we know lots of people like Fish and zsh which have a lot of additional features, too.

19 thoughts on “Linux Fu: Modernize Your Command Line

  1. eh, layers of cruft. Who’s brave enough to rip it all out and use something truly different like scsh? :)

    Or since “it’s not linux, it’s GNU/linux” or rather, GNU/win64 these days, how about PowerShell? I’m not an MS person, but I do hear of wonderful things being possible in PS around its .net native integration. I’m not sure what the linux equivalent would be: direct syscalls or maybe calling named entry-points on so-files? That sort of magic does kind of need a unified environment like .net though, and linux sadly doesn’t seem to have an equivalent.

    PS: your linux-fu series needs an intro to the wonders of ssh including key management, links to hardening guides, and how to do tunnels+proxies, both forward and reverse. It would be particularly valuable I suspect for the Pi crowd…

    1. Yeah I keep trying to swtich shells but always go back for a variety of reasons.

      We did a bunch of pieces on hardening the Pi and some ssh topics before we started “Linux Fu” — but they are there. Of course, you can always do more. Also, if I recall, the comments on some of these had some real gems in them.

      No particular order.

      https://hackaday.com/2016/09/30/lock-up-your-raspberry-pi-with-help-from-google/

      https://hackaday.com/2016/09/21/how-to-run-a-pagekite-server-to-expose-your-raspberry-pi/

      https://hackaday.com/2016/09/20/expose-your-raspberry-pi/

      Great [Joe Kim] art on those, as usual.

      THere are probably a few others but those jumped out on a quick search.

    2. My favourite thing about Powershell is that the syntax is pretty much consistent across different commands, which is a nice change after you’ve had to look up the man page for tar for the third time in a day.

  2. Whomever wrote bat needs to do some basic reading on color choice. Rather than highlighting syntax this scheme makes them easy to skip over while all the white text jumps out. Maybe that was their aim but it looks so noisy to me it’s the opposite of helpful.
    It’s like that list of colors written in different colored ink & you have to say the color of the ink not the color written.

    1. Funny you mention that. I use Konsole with a peculiar background and black text. Bat totally washes out on my screen. I haven’t played with it much but try: bat –list-themes and see if any of those help you out.

      1. I guess I must be getting old.
        Highlighting syntax just makes the code harder to read. I’d rather write code in notepad ( or notepad++). Syntax highlighting isn’t that helpful to me, again it just increases visual noise, I’d rather have plain text or bolded key words.
        I guess I’m not their target audience.

  3. I would like to strangle the person who colorized ls and vi. My god, DOS is not even that bad.

    I guess I am old fashioned, but I have strong feelings that the basic tools should not be screwed around with.

    1. You do know the default for ls is no colors, right? Most of the distros set up:

      alias ls=’ls –color=auto’

      for you. Just take that out. You can also set –color=never but that’s the default, anyway.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.