UNIX Commands I Wish I Had Known

Ardant Wiki Home | Recent Changes | Preferences | Comments
 
Difference (from prior major revision) (no other diffs)

Added: 6a7
;comm:Finds lines common to two files. The arch-enemy of diff.

Added: 8a10,11
;par:A fmt swiss army knife. Better looking formatting (DP instead of Greedy); handles quotations, prefixes, and suffixes; text justification; hanging lines, and so much more!
;paste:Opposite of cut. Used to create lines from multiple files. Like join, without the need for explicit keys.
 

There are hundreds upon hundreds of UNIX commands. Most you never encounter in your daily life, most you never know existed. If I had known all of these the day I started, I would have saved myself hours upon hours of writing my own scripts, proggies, etc.

Most of the commands are atomic: designed to take input from stdin and output to stdout. They're useful in pipes, in scripts, called from vim. That's why they're useful. Some are obscure, some aren't.

I wish I had started generating this list as I discovered the useful commands. I guess it's more of a work in progress now, as I use the commands (and remember their existence) I'll add them here. And by all means e-mail me if you have something interesting to add!

comm
Finds lines common to two files. The arch-enemy of diff.
cut
This command does it all! Cut a range of characters, a range of fields, output with different delimiters.
fmt
Format text into a certain width, normalize the number of spaces after periods, perform indentation.
par
A fmt swiss army knife. Better looking formatting (DP instead of Greedy); handles quotations, prefixes, and suffixes; text justification; hanging lines, and so much more!
paste
Opposite of cut. Used to create lines from multiple files. Like join, without the need for explicit keys.
sort
Commonly used, but ever so powerful. Fast sorting.
tac
Backwards cat. Prints a file from bottom to top.
tee
Duplicate stdin into both a file and stdout. For extra use, tee on a pipe, or to a device. Display both your output -and- log it.
tr
Trim text. Replace characters, remove characters. Toggle case done easily here.
uniq
Print out only duplicated lines, trims duplicates from stdin! Same as sort -u
watch
Repeatedly monitors the output of a command, e.g. who or ps. Also can be used to periodically run a command.
wget
Fetches a webpage, possibly to standard out with -o -. Useful in shell scripts.
 
Ardant Wiki Home | Recent Changes | Preferences | Comments
This page is read-only | View other revisions
Last edited November 29, 2004 10:10 pm (diff)
Search: