Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

awk script to parse output of ps command

Tags:

awk

I have never worked on programming languages before. I am learning C and unix architecture by refering online links. I got small exercise to write awk script to parse output of ps command. please help and please provide me the names of best books for C & awk scripting.

like image 492
Nilesh Avatar asked Sep 05 '10 16:09

Nilesh


1 Answers

Lets say you want to list just the command column(8th column) from the ps -ef output, you can do:

ps -ef | awk '{print $8}'
like image 125
codaddict Avatar answered Sep 21 '22 16:09

codaddict