Notes of a Systems Administrator
Monday, 29 February 2016
Regex with awk
To use a regular expression in awk use the operator ~ and //, e.g/:
cat home-dir.txt | awk '{if ($3 !~ /^[0-9]/) print $0;}'
to print any line that does not have a number in column 3
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment