> true
> false
> sort [-k n [ ,m ]] [ -n ] [ -r ] [ -u ] [ file ]
> sort
-k
,
-n
-r
-u
> uniq [ -c ]
> uniq
-c
Filters out adjacent matching lines. -c - Print a count
Example:
users | tr ' ' '\n' | uniq -c
> basename name [ suffix ]
> basename
> dirname name
> dirname
file="/some/path/to/file.txt"; dir=$(dirname "$file"); # dir <- "/some/path/to" filename=$(basename "$file"); # filename <- "file.txt" basefilename=$(basename "$file" ".txt"); # basefilename <- "file"
> tr [ -d ] set1 [ set2 ]
> tr
-d
> tac
> colrm [ first [ last ]]
> colrm
ps aux | grep -v root | colrm 16 60
> cut [ -f field-number(s) ] [ -d deliminator-character ]
> cut
-f
cut -f 1 -d : /etc/passwd
> tee
ps aux | tee ps.out
ps aux
ps.out
> env
env -i PATH=/bin HOME=/tmp printenv
> date [-d when] [+format ]
> date
+
time=$(date +%s); Get the time in seconds since the epoch
time=$(date +%s);
date -d yesterday Yesterdays date
date -d yesterday
date -d '2021-03-01 yesterday' Last day of February 2021
date -d '2021-03-01 yesterday'