Tips on Unix utilities and related topics from @JohnDCook.

Joined August 2011
201 Photos and videos
Pinned Tweet
'The enjoyment of one's tools is an essential ingredient of successful work.' -- Donald E. Knuth
12
337
621
Was reading up on dc and a source said one of its advantages is its use in obfuscated code competitions. If a language is good for writing obfuscated code, maybe that’s a bad sign.
2
13
3,467
Unix tool tip retweeted
I talked to a man yesterday who has 5 virtual assistants. I only have two: Python and Bash. I used to have a virtual assistant named Perl but I had to let her go. I got along with her OK but not the rest of my staff.
2
2
49
3,392
Linux commands: a practical reference pixelbeat.org/cmdline.html

1
20
2,896
Sort a file numerically: sort -n
9
1,623
You can look for files between a pair of dates using -newermt twice: files with newer modification time than one date and not newer than another date. find . -type f -name "*.tex" -newermt "2025-03-01" ! -newermt "2025-06-01" Note the command has a bang, not a pipe.
1
1
16
1,822
Show tabs in a file: cat -T
8
1,370
The awk variable NR contains the current record number.
7
1,561
In bash, !$ expands to last word of previous command.
1
8
1,397
Gnu sed allows addresses of the form start~step. For example, 1~2 matches odd-numbered lines.
1
10
1,586
Useful Perl one-liners catonmat.net/download/perl1l… by @pkrumins

11
1,715
Latest edition to my Emacs config file: ;; Toggle frame maximization (when (display-graphic-p) (global-set-key (kbd "C-c m") #'toggle-frame-maximized))
1
14
2,588
delete from line 3 up to and including first blank line: sed 3,/^$/d filename
8
1,741
The option -w or --ignore-all-space tells diff to ignore spaces in one line even where the corresponding line has none.
1
11
1,725
Search man pages for a given string: man -k string
2
1
13
2,125
sed script to delete blank lines /^$/d
2
16
2,137