Live data from Hacker News

Ask HN: What are your favorite UNIX tools?

news.ycombinator.com

11–15 of 15 posts

Re: Ask HN: What are your favorite UNIX tools?

#11
find

My command to backup selected file using Tarsnap. find /Users/xyz/Analysis -type f \( -name '.pdf' -o -name '.docx' \) -print0 | tarsnap --dry-run --no-default-config --print-stats --humanize-numbers -c --null -T-

This command file files ending with docx and pdf to back with tarsnap. The "-" following the "-T" option allows to pass the name using std-in via find command

Re: Ask HN: What are your favorite UNIX tools?

#13
Most: grep, find, cat, sort, tail, wc, ls, sudo, pgrep.

Interesting: comm: https://linux.die.net/man/1/comm

Compare sorted files FILE1 and FILE2 line by line.

With no options, produce three-column output. Column one contains lines unique to FILE1, column two contains lines unique to FILE2, and column three contains lines common to both files.

-1 suppress column 1 (lines unique to FILE1)

-2 suppress column 2 (lines unique to FILE2)

-3 suppress column 3 (lines that appear in both files)

Weak: adduser/useradd (hard to non-interactive), chmod (could use file/dir filter with -R).

Least: systemctl, journalctl.

Re: Ask HN: What are your favorite UNIX tools?

#15
post #13

Most: grep, find, cat, sort, tail, wc, ls, sudo, pgrep. Interesting: comm: https://linux.die.net/man/1/comm Compare sorted files FILE1 and FILE2 line by line. With no options, produce three-column output. Column one contains lines unique to FILE1, column two contains lines unique to FILE2, and column three contains lines common to both files. -1 suppress column 1 (lines unique to FILE1) -2 suppress column 2 (lines un…

One trick I learned from a UNIX greybeard in my junior days before pgrep was widely avaialble is: ps auxw | grep [p]rocessname and it will eschew the grep process in the list.
Post reply on HN