dcsimg
Linux Today: Linux News On Internet Time.





More on LinuxToday


Exercise #2: Learning awk with Operators

Feb 15, 2011, 00:03 (0 Talkback[s])

WEBINAR:
On-Demand

How to Help Your Business Become an AI Early Adopter


[ 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

Related Stories: