shuf
cut
tr
lp
sort
Options:
-t, --field-separator=SEP
use SEP instead of non-blank to blank transition
-k, --key=POS1[,POS2]
start a key at POS1 (origin 1), end it at POS2 (default end of line)
-h, --human-numeric-sort
compare human readable numbers (e.g., 2K 1G)
-n, --numeric-sort
compare according to string numerical value
nproc
print the number of processing units avaiable.
od / xxd / hexdump
read the binary file.
Notes: byte order
1 | $ echo -n "ABCD" | xxd |
comm / diff / tkdiff / cmp
Can be used to compare binary or non-binary files.
comm
compare two sorted files line by line.
1 | $ cat file1.txt |
The file must be sorted before using the comm
command. Otherwise it will complain that:
comm: file 1 is not in sorted order
and cannot work correctly. For example,
1 | $ cat file1.txt |
diff
Syntax:
diff -u file1 file2
Options:
-e, --ed
output an ed script
-u, -U NUM, --unified[=NUM]
output NUM (default 3) lines of unified context
(that is, print NUM lines before and after the difference line)
tkdiff
Use a GUI to display the differences.
cmp
Prints less information comparing to diff
.
Syntax:
cmp file1 file2