Tag Archives: awk

Cool AWK trick – remove duplicate lines without sort

I always do something like cat file | sort -n | uniq to get a unique listing of a file to remove duplicates. the only problem with this is that it sorts the list so the ordering of the file … Continue reading

Posted in System Stuff | Tagged , | Leave a comment

awk stuff

print all lines in a file that match some pattern awk ‘$0 ~ /pattern/ {print $0}’ awk ‘NR % 6′ # prints all lines except those divisible by 6 awk ‘NR > 5′ # prints from line 6 onwards (like … Continue reading

Posted in System Stuff | Tagged | Leave a comment