GTKC Knowledgebase
A little bit of wisdom
Using awk to filter text files for specific columns of information
Posted by  Admin on


Using awk to filter specific information.
# print column one using space as a separator
grep  /var/log/maillog.1 | awk '{print $1}'

# print column four using : as a separator
grep  /var/log/maillog.1 | awk -F ":" '{print $4}' 


Use grep -i for case insensitive search.




Tags: Text manipulation , AWK , Linux

Return to home page: Home