Created
May 10, 2013 19:53
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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