Command line cheat sheet

Using the command line might be frightning at first but it is a valuable and flexible skill that can be used for many purposes. This cheat sheet eases that steep learning curve.

Finding occurences in text files

Find the number of lines that contain lorem ipsum in baz-files but not if that file is in a folder foo or bar:

grep -R --exclude-dir=foo --exclude-dir=bar --include=*.baz "lorem ipsum" | wc -l

A construction to generate a frequency sorted list of files that show which files have the most lines containing lorem ipsum:

grep -R --exclude-dir=foo --exclude-dir=bar --include=*.baz "lorem ipsum" | cut -d ":" -f 1 | sort | uniq -c | sort -hr
Keeping an eye on things
iostat 1
ifstat -i enp7s0f1 -i tun0
Loopback audio


pactl load-module module-loopback latency_msec=1

(Have fun repeating this with different latencies.)


pactl unload-module module-loopback

(You could also just use this GNOME extension.)