[フレーム]
Last Updated: February 25, 2016
·
1.996K
· christianromney

Slim down your shell pipeline with Awk

Ever pipe a file to grep in order to limit the output to matching rows only to pipe it to awk so you can print a single column? Perhaps like this:

$ netstat -tn | grep tcp | awk '{print 6ドル}' | sort | uniq -c

Save a couple of keystrokes by having awk pull double-duty:

$ netstat -tn | awk '/tcp/ {print 6ドル}' | sort | uniq -c

Happy Awking!

AltStyle によって変換されたページ (->オリジナル) /