Tips on Unix utilities and related topics from @JohnDCook.

Joined August 2011
'The enjoyment of one's tools is an essential ingredient of successful work.' -- Donald E. Knuth
8
351
11
533
Change the third 'apple' in each record to 'orange': sed 's/apple/orange/3' somefile
0
7
0
34
Linux commands: a practical reference pixelbeat.org/cmdline.html
0
10
0
36
Sort a file numerically: sort -n
0
2
0
19
Show tabs in a file: cat -T
1
5
0
29
"Unix tools are great for text munging, but that's not what my problem requires." "Maybe you should turn your problem into one that can be solved with text munging."
OH: "If you think paredit is not for you then you need to become the kind of person that paredit is for."
3
8
1
46
Unix tool tip retweeted
OH: "If you think paredit is not for you then you need to become the kind of person that paredit is for."
0
47
1
33
The awk variable NR contains the current record number.
0
4
0
28
In bash, !$ expands to last word of previous command.
2
6
1
48
Gnu sed allows addresses of the form start~step. For example, 1~2 matches odd-numbered lines.
0
1
0
24