---

Exercise #2: Learning awk with Operators

[ Thanks to Andrew
Weber
for this link. ]

“The 10 Days of awk

“Our “10 days of awk” tutorial series is in full swing. This awk
short-course includes tutorials, videos and exercises which are
rolled out each day in an effort to help admins use awk more
confidently.

* Exercise 1: Learning awk Basics
* An awk Example – Checking Processes for Memory Use
* Exercise 2: Learning awk with Operators
* Exercise 3: Using awk with Print and Printf

“”In this example the search is for processes that are using
1.0% or more of the system memory. The operator “>=” is used to
find that information.

awk ‘$4 >= 1’ processes
root 14022 0.0 1.0 10012 2840 ? Ss Feb08 0:00 /usr/sbin/httpd
root 15857 0.0 1.1 10032 2900 ? Ss 12:02 0:00 sshd:
root@pts/0


Complete Story

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis