List of really handy and/or useless command line tools

Posted on


This is a list of useful command line tools which I often use during my day. For every tool I have listed a example with the parameters and the output of the tool.


$ toolname --option=value --other-option
Output of toolname when run on my machine.
This might not be identical on your installation.


With apropos you can search all man entries of programs. With this you can find programs which do things related to a keyword like “cdrom” or “file”.


$ apropos font
pamtompfont(1) - see
ppmdcfont(1) - see
ppmddumpfont(1) - see
ppmdmkfont(1) - see
addftinfo(1) - add information to troff font files for use with groff
afmtodit(1) - create font files for use with groff -Tps
atsutil(8) - font registration system utility
font(ntcl) - Create and inspect fonts
fontd(8) - Mac OS X system font registration manager
fontmover(8) - Mac OS X system font mover
fontrestore(8) - Restore the available system fonts to a pristine state, if possible
fontworker(8) - Mac OS X system font registration and validation daemon
groff_font(5) - format of groff device and font description files
hpftodit(1) - create font description files for use with groff -Tlj4
lj4_font(5) - groff fonts for use with devlj4
pfbtops(1) - translate a PostScript font in .pfb format to ASCII
tfmtodit(1) - create font files for use with groff -Tdvi


Whois is a command to get the information about domains and their users, like the nameserver or technical contact.


$ whois
whois: This information is subject to an Acceptable Use Policy.

Domain name:

Holder of domain name:
Robin Glauser
Niesenstrasse 26C
CH-3600 Thun
Contractual Language: German

Technical contact:
cyon GmbH
David Burkardt
Aeschengraben 6
CH-4051 Basel

cyon GmbH

First registration date:


Name servers:


With curl you can create http requests and print the response to the standard output.

Example (Output shortened):

$ curl
<!DOCTYPE html><meta charset="utf-8"><title>Robin Glauser | Portfolio</title><meta name="description" content="My portfolio"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="icon" type="image/x-icon" href="../favicon.ico"><link rel="shortcut icon" type="image/x-icon" href="../favicon.ico"><style>*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.jumbotron{padding:30px;margin-bottom:30px;background:#2c3e50;color:#fff;text-align:center}img{border:0;vertical-align:middle}.jumbotron{padding-top:48px;padding-bottom:48px}@media screen and (min-width:768px){.jumbotron{padding:48px 0}}body{font-family:"Source Sans Pro",Candara,Arial,sans-serif;....


With the uptime command you can see how long your machine has been running.


$ uptime
12:46 up 1 day, 9 mins, 3 users, load averages: 1,87 1,86 1,86


Ps is a command to list and filter all processes running on your machine. By default it only lists the processes running in your current shell.

Example without any arguments:

$ ps
 2091 ttys000 0:00.01 -bash

If you provide the argument -e all processes will be listed.

Example with argument -e (Output shortened):

$ ps -e
 1 ?? 0:59.60 /sbin/launchd
 42 ?? 0:10.80 /usr/libexec/UserEventAgent (System)
 43 ?? 0:20.07 /usr/sbin/syslogd
 45 ?? 0:11.36 /usr/libexec/kextd
 46 ?? 0:19.04 /System/Library/Frameworks/CoreServices.framework/Vers
 50 ?? 0:00.46 /System/Library/CoreServices/appleeventsd --server
 51 ?? 0:06.37 /usr/libexec/configd
 52 ?? 0:02.25 /System/Library/CoreServices/powerd.bundle/powerd


With ln you can create symbolic and hard links between files or directories. The difference between the two is that symbolic links work over multiple partitions and has its own Inode. A hard link instead points to the same Inode as the referenced file.

Just remember to first provide the file or directory which already exists and then the new file for the link. In most cases a symbolic link is what you want.

Example for creating a symbolic link:

$ ln -s existing_file linked_file

Example for creating a hard link:

$ ln existing_file linked_file


Ping is one of the more simple commands in this list. It will “ping” the host you’ve provided as the first argument by sending  (ICMP) echo request packets to it.

The command will run until you stop it with the key-combination (Ctrl+C). It the displays a statistic about how many packets were lost and how long it took for the packets for the round-trip.


$ ping
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=58 time=7.591 ms
64 bytes from icmp_seq=1 ttl=58 time=7.867 ms
64 bytes from icmp_seq=2 ttl=58 time=7.879 ms
64 bytes from icmp_seq=3 ttl=58 time=7.569 ms
--- ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 7.569/7.726/7.879/0.147 ms


Wget is similar to curl, but instead of printing the response of the web-server it saves it to your hard-drive. It also has options for saving a whole website locally so you can access it without a internet connection.


$ wget
--2015-10-02 13:08:02--
Resolving ( 2a00:1450:400a:806::1005,,, ...
Connecting to (|2a00:1450:400a:806::1005|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: [following]
--2015-10-02 13:08:02--
Resolving ( 2a00:1450:400a:805::101f,,, ...
Connecting to (|2a00:1450:400a:805::101f|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified

Saving to: ‘index.html’

index.html [ <=> ] 19.29K –.-KB/s in 0s

2015-10-02 13:08:02 (53.1 MB/s) – ‘index.html’ saved [19748]

Example for copying a whole website to your hard-drive:

$ wget --mirror -p --convert-links -P fly/
--2015-10-02 13:10:44--
Resolving (
Connecting to (||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified

Saving to: 'fly/' [ <=> ] 8.87K --.-KB/s in 0.01s

Last-modified header missing -- time-stamps turned off.
2015-10-02 13:10:49 (870 KB/s) - 'fly/' saved [9079]

Loading robots.txt; please ignore errors.
--2015-10-02 13:10:49--
Connecting to (||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 106

Saving to: 'fly/' 100%[===================================================================>] 106 --.-KB/s in 0s


FINISHED --2015-10-02 13:10:51--
Total wall clock time: 6.9s
Downloaded: 17 files, 878K in 0.4s (2.26 MB/s)
Converting fly/ 13-2
Converting fly/ 12-1
Converting fly/ 9-1
Converting fly/ 5-1
Converted 4 files in 0.004 seconds.




With tree you can show the structure of a directory as a ascii-tree.


$ tree
├── About
├── FAQ
├── bundles
│   └── fly
│   ├── assets
│   │   ├── ack.png
│   │   ├── filezilla.png
│   │   ├── firefox.png
│   │   └── vim.png
│   ├── fonts
│   │   ├── glyphicons-halflings-regular.eot
│   │   ├── glyphicons-halflings-regular.eot?
│   │   ├── glyphicons-halflings-regular.svg
│   │   ├── glyphicons-halflings-regular.ttf
│   │   └── glyphicons-halflings-regular.woff
│   ├── img
│   │   └── favicon.ico
│   └── js
│   └── vendor
│   └── modernizr-2.6.2-respond-1.1.0.min.js
├── css
│   └── compiled
│   └── main.css
├── index.html
├── js
│   └── compiled
│   └── main.js
└── robots.txt

11 directories, 17 files


With fallocate you can quickly create dummy files with a given size for testing.


$ fallocate -l 100M dummy_file


Wc displays the lines, words, and bytes of a given input file.


$ wc index.html
 7 428 19748 index.html


With the finger command you can find out which users are logged in at the moment.


$ finger
Login Name TTY Idle Login Time Office Phone
robin Robin Glauser *con 1d Do 12:37
robin Robin Glauser s00 Fr 13:16

Leave a Reply