category 09 / 10
Dates & math
Timestamps, arithmetic, base conversion, and date formatting.
005
entries
4 min
avg read
049Turn raw byte counts into human-readable sizes in any command's outputwc -c *.* | numfmt --field=1 --to=iec-i --suffix=B --padding=7042Count from 01 to 12 with the zeros already in placeseq -w 1 12034Do decimal math in the shell when $(( )) only gives you integersecho 'scale=3; 2/3' | bc024Do math on zero-padded numbers without the shell reading them as octalecho $(( 10#$(date +%m) ))014Turn a Unix timestamp into a readable date in any timezoneTZ=America/New_York date -d @1788373391 +'%F %T %Z'
showing 005 of 005