Management Portal

The Best Commands You Never Knew About in Linux

command - mount with column

The Best Commands You Never Knew About in Linux

(Adapted from a Reddit thread)

Even some of the best systems administrators have a helpful command or two that they’ve never heard of. Don’t be embarrassed! See if you’ve never heard of any of these and give them a try – I guarantee they’ll save you some time, or at the very least, make you go “oooh, that’s cool!”

column – Utility that sorts input into multiple columns.
Cool command to try: mount | column –t

dstat – System utilization monitoring. Quickly tells you CPU usage, disk usage, bandwidth usage, memory, paging, load, and process statistics. Many other options available.
Cool command to try: dstat –a

tac – What’s the opposite of a cat? Tac, of course. Prints out a file in reverse.
Cool command to try: tac <filename>

ctrl+r – Searches your command history. Forgot that long perl expression you painstakingly typed out yesterday? Try ctrl+r.

watch – Performs a command every x number of seconds for y amount of time.
Cool command to try: watch –interval 3 df –h

!$ – Stores the value of the last argument of the previous command ran.
Cool command to try: cat <filename> | echo !$

htop – Interactive process viewer designed to replace “top”. Prefer to be able to kill a process right from the list of processes? htop is your tool.

diff3 – You’ve probably used diff, but have you ever needed to compare the results of three different files? Check it out:

[root@server ~]# diff3 hi hi2 hi3
====
1:1c
hi hi hi
2:1c
hi2 hi2 hi2
3:1c
hi3 hi3 hi3

cal – Ever been doing something in a terminal and need to quickly view a calendar? Type “cal” and see what happens!