awk

Basic syntax awk [ options ] script filename Where script is either a single awk command or file of awk commands. Awk commands look like this: TODO and filename can be omitted if you’re piping in standard input. Commands Options Examples Length of the longest line in a file awk '{ if (length($0) > max) max = length($0) }; END { print max }' file Selecting, filtering, and basic arithmetic Sum a field, specify delimiter awk -F '\t' '{print sum+=$1;} END {print sum}' file....

February 7, 2022 · 1 min · Me

Count files by type and directory

Using the command line to count stuff

December 17, 2020 · 5 min · Colin