Awk Cheatsheet

Links Awk tutorial Pattern matching (grep) # Should return one line per file ls -a | awk '//' # Should print files starting with a dot ls -a | awk '/^\./' Counting (wc) ls | awk '{i++} END {print i}' # Should return number of files Delete all svn-files with an exclamation mark in svn status svn status | awk '/^!/{print $2}' | xargs svn delete --force Find only the first match and print it echo data | awk "/$pattern/{print;exit}" Ignore the first line echo data | awk 'NR>1' Ignore duplicate lines echo data | awk '!...

March 24, 2016  |  🏷️Awk