My favorite hidden gems in a base UNIX install are `tac` (print lines in reverse order) and `tr` (character substitutions).
Ask HN: What are your favorite UNIX tools?
1–10 of 15 posts
Re: Ask HN: What are your favorite UNIX tools?
#2Re: Ask HN: What are your favorite UNIX tools?
#3(It's a guilty pleasure to write shell pipelines that use awk to write a shell script and then pipe that script in sh, I find it easier than looking up the bizzaro syntax for loops in bash in the info pages.)
Re: Ask HN: What are your favorite UNIX tools?
#4wc is also useful, mostly as "wc -l". If you keep data in line oriented, human readable form, "wc -l" counts data items.
Re: Ask HN: What are your favorite UNIX tools?
#5Re: Ask HN: What are your favorite UNIX tools?
#6awk (It's a guilty pleasure to write shell pipelines that use awk to write a shell script and then pipe that script in sh, I find it easier than looking up the bizzaro syntax for loops in bash in the info pages.)
Do you have any examples of this?
Re: Ask HN: What are your favorite UNIX tools?
#7Re: Ask HN: What are your favorite UNIX tools?
#8printf - shell is natively great at interpolation already, but having C-style printf formatting is often useful and echo has a lot of footguns
Re: Ask HN: What are your favorite UNIX tools?
#9awk (It's a guilty pleasure to write shell pipelines that use awk to write a shell script and then pipe that script in sh, I find it easier than looking up the bizzaro syntax for loops in bash in the info pages.)
> use awk to write a shell script Do you have any examples of this?
ls -l *.txt | awk '{if ($5
to cat text files that are less than 2000 bytes longRe: Ask HN: What are your favorite UNIX tools?
#10Probably the pipe itself would be my favorite next.
Then in no particular order: tail, cut, xargs, wc, tr, grep, sort, uniq.