awk tips Aug 19, 2018 looping: cat people.data | awk 'BEGIN{a=0} {printf("%d,%s\n", a++, $0);}' printing path elements: assuming the path /one/two/three/four/five/foo.jar find /one/two -name foo.jar | awk -F/ '{print $(NF-1)}' Will output: five