- To print example.txt between the first appearance of foo and the following appearance of bar (both included)
- awk '/foo/,/bar/' example.txt
- To print the names for all users in the passwd file
- awk -F: '{ print $1; }' /etc/passwd
- ... and to print all excepting root and ftp
- awk -F: '!/^(ftp)|(root)/ { print $1; }' /etc/passwd
Links | top |
Last update: Wed, 2 Nov 2005 10:16:21 GMT | top |