What do cut, sort, uniq, wc, tr, and xargs do?
BeginnerConceptPackages, Shell & Text Tools
Answer
cut -d: -f1,7 /etc/passwd # fields by delimiter
sort -k2 -n -r file # numeric reverse on column 2
sort | uniq -c # count duplicates (uniq needs sorted input)
wc -l file # line count
tr 'a-z' 'A-Z'; tr -d '\r' # translate or delete chars
find . -name '*.tmp' -print0 | xargs -0 rm -f # safe with spaces
More on Packages, Shell & Text Tools
Compare apt and dnf package management.BeginnerWhat is the difference between `apt upgrade` and `apt full-upgrade`?IntermediateHow do you find which package provides a file or command?BeginnerHow do you pin or hold a package version?IntermediateHow are repositories and their GPG keys configured?AdvancedWhat is the difference between a login shell and an interactive non-login shell?Intermediate