20 useful Linux shell utilities you may have never seen

super_awesome_ninja_penguins_by_ultimatedragon

If you totally get to the bottom of Linux shell – you’ll agree that it’s a powerful environment. Understanding of things like text manipulators, system utilities etc. makes a great deal in operations performance. But sometimes we have a desire to simplify command line toolkit. Days go by and we’re starting to notice that some mechanisms could be better. Command history search is complicated. “du” scrolling doesn’t show up a descriptive filesystem usage statistics. And sometimes instead of command line we’re picking GUI programs. Despite of we know this way as less productive.

But here is the simple rule: if you need a feature – invent it yourself! Some developers are going that way turning Linux from powerful into unbelievable powerful. Inspired by awesome-shell list I pointed the most useful and put it together at this post. Hope most of them should work on Mac OS environment too. So, here is my ranking. Don’t pay attention on numbers, this range is chaotic. This post could look too long for you. In that case just scroll down and look at the nice shell screenshots (joke sucks, i know).

1. bashmarks


npvm3606hty

The point: single bash script allows to point bookmarks on favorite directories. What it takes if your working directories have a huge path needs to be typed every time.

Alternative to: alias.

Github project: huyng/bashmarks.

2. bd


n4hazremunq

The point: helps you to go down on the filesystem tree to desired directory. Using great if you wish to climb up through many directory levels simultaneously.

Alternative to: cd ../../../../..

Github project: vigneshwaranr/bd.

3. hhighligther


wrdtfndojli

The point: single script which lets to pick many patterns with different colors at the same time. Based on “ack” tool. Looks more flexible than grep.

Alternative to: grep –color.

Github project: paoloantinori/hhighlighter.

4. hstr


55xgp0pr3ry

The point: command history navigator. Much more visual than default reverse search. Also runs by “Ctrl + R” command.

Alternative to: reverse search (Ctrl + R)

Github project: dvorka/hstr

5. fuck (thefuck)


okurboib0do

The point: as funny as important utility which remarking typos you did in previous command and run it. You might heard about “thefuck”, because it’s really popular program.

Alternative to: basically there is no alternative. Sometimes bash or fish can help you by prompt, but it’s a rare case.

Github project: nvbn/thefuck

6. mysql-colorize


lzbhr5rjj8a

The point: colorization of MySQL command prompt. Makes query results pretty articulate.

Alternative to: colour-mysql-console (external too).

Github project: mysql-colorize.bash

7. cloc


wsqs6rjqdj8

The point: the best lines of code counter. Accepts all popular and unpopular programming languages, splits “real code” from comments and blank. Easy to install, easy to use, hard to confuse, for project analysis priceless use. Hope you know this program but I couldn’t go around this.

Alternative to: plenty of alternatives

Github project: AlDanial/cloc

8. sshfs


w8p-rbtvoxi

The point: mounts remote host filesystem allowing to exchange data through ssh. Priceless if you want to edit files directly from your machine with immediate results. All folders will be synced, that’s great for Vagrant fans.

Alternative to: NFS and FTP connections.

Github project: osxfuse/sshfs

9. glances


The point: powerful monitoring utility. Explains all walks of your system in one window. Written in Python. Also supports client-server mode which seems a great opportunity to track remote hosts.

Alternative to: top/atop/htop.

Github project: nicolargo/glances

10. mtr


xqbdavyrzgo

The point: hybrid of “ping” and “traceroute”. Allows to keep an eye on each hop routes your traffic. Provides useful statistics and helps to define problem in your network.

Alternative to: ping, traceroute and ping with traceroute together

Github project: traviscross/mtr

11. screen


The point: default GNU command line multiplexer. Helps to lead multiple sessions. The most useful appliance – keep many remote SSH/Telnet connections at the same place. Management through hotkeys (mostly “Ctrl+A” with something). Of course, you know what screen is and probably know how it works. But, as sure as mtr and cloc, I can’t skip it in Linux utilities report. There is a wide choice of screen multiplexers like tmux or byobu. But I’m learning “screen” usage and recommend you too. We need to be friendly with GNU tools, because it’s a headspring of open source empire. Democratic empire. Repeat one more time: GNU/Linux, not only Linux.

Alternative to: byobu, tmux, wemux.

Github project: actually not. Use GNU repository: git://git.savannah.gnu.org/screen.git.

12. ncdu


hdw1vli194k

The point: shows up your filesystem components amount using command line graphic. Definitely effective if you have a lack of free disk space and try to find out objects which take too much memory. Looks much more representative than “du” command.

Alternative to: du

Github project: actually there is no official GitHub repo. If you’re interested – go to the project website.

13. bitpocket


bjkofuevfwm

The point: supports local and remote folders synchronization. Looks like “git” and “rsync” hybrid. You’ll love it if you have a git addiction and try to make any operation using CVS.

Alternative to: rsync, git and rsync with git together.

Github project: sickill/bitpocket

14. httpie


vcxdqch3xo0

The point: Python project as a new kind of HTTP command line client. Represents HTTP requests toolkit, supports all kinds of messages, HTTPS protocol as well. Prints out result in JSON format if your command includes data. Colorful and looks articulate. Header customization is permitting too. The most awesome tool for webserver troubleshooting or just for website interaction.

Alternative to: curl

Github project: jkbrzt/httpie

15. saws


The point: interactive replacement of AWS console. Saves your brain from thouthands of command options replacement. Take in in your cloud!

Alternative to: just stay on AWS CLI.

Github project: donnemartin/saws

16. transfer.sh


kleurxpvmqo

The point:simple script based on curl. Helps to push files on the fly to the transfer.sh hosting. Takes like air if you’re working on isolated environment (RDP, KVM) and trying to ship text file. It could be a log, piece of code, basically whatever is worth to your destination person. Also you can change a hosting location to yours. Amazon S3 buckets supported.

Alternative to: curl, many copy/paste drudgery.

Github project: dutchcoders/transfer.sh/

17. whereami


s3fdmej2uqg

The point: defines your location by freegeoip.net. Based on node.js. There is a choice of formats: latitude/longitude coordinates, city/country format, JSON. Useful if you want to know where is your remote host located or if you got lost in the jungle. Also you can check the result of IP address substitution by any means and by all goals.

Alternative to: “dig +short myip.opendns.com @resolver1.opendns.com”

Github project: rafaelrinaldi/whereami

18. shellcheck


rkfprzqv8_k

The point: smart shell script parser, detecting errors and unlogical operations. It’s just one of multitudinous tools for bash testing. If you’re developing shell scripts – that’s the way to organize it productively. If Bash is not a fully functional language by Alan Turing rules – it doesn’t mean that you cannot debug it.

Alternative to: assert.sh, ts and many miscellaneous testing tools more. And, of course, bash -x

Github project: koalaman/shellcheck

19. dotfiler


yelke-pfmy4

The point: helps to collect all configs (.bashrc, .gitignore etc.) in the single directory. Other dotfile management tools could be more comfortable for you. The main thought of this – start to keep an eye on your dotfile configs. They can spawn and turn your home directory into the big trash warehouse. Also that’s a great backup in case of emergency.

Alternative to: fresh, homeshisk, vcsh for the same goal

Github project: svetlyak40wt/dotfiler

20. imagescraper


orzglpsywjg

The point: Python bot diving into web-page and downloading all images has been found. Suggesting to set a limit on file size, images number and manky kinds of other through options. Such useful if you want to grab all images from any webpage, but have to save it manually one by one. That takes a lot of time.

Alternative to: few GUI utilities, but we know what’s better, right?

Github project: sananth12/ImageScraper

Bonus.

You may want to try it all, but don’t have any time and desire to go through 20 installation processes. So, here is my attempt to collect it all in a single bash script. I tried to make it interactive, so make a choice, what install and what’s not. You can install everything described there by single script execution. Here is some command line apps included, but I’d like to make another post about it. Also I didn’t include any special tool for Git. They’re also awesome to organize your interaction with CVS. But now single git command is really enough for me, thus I can’t suggest anything at present. Hopefully I’ll write about them in the future.

You probably lost your jaw looking at features which Linux developers community provide. But there is no limit: we can improve shell productivity anytime by any side. Hope this post amazed you and inspired to developing new command line instruments.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s