4 ms·
Most: grep, find, cat, sort, tail, wc, ls, sudo, pgrep. Interesting: comm: https://linux.die.net/man/1/comm https://linux.die.net/man/1/comm Compare sorted fi
by wruza 2y ago
Most: grep, find, cat, sort, tail, wc, ls, sudo, pgrep.
Interesting: comm: https://linux.die.net/man/1/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.
- commandersaki 2y agoOne 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.