Skip to content

Instantly share code, notes, and snippets.

@rcmorano
Created May 10, 2013 19:53
Show Gist options
  • Save rcmorano/5556947 to your computer and use it in GitHub Desktop.
Save rcmorano/5556947 to your computer and use it in GitHub Desktop.
Print a column selectively with #awk. Think about it like selecting a complete row (or just a column) when a column in the row matches your needs.
awk -F: '$NF == "/bin/tcsh" {print $1}' /etc/passwd
awk -F: '$1 == "johndoe" {print $1}' /etc/passwd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment