[Solved] how to extract word from ps -aux

Since it’s not clear what you’re trying to do: If you expect the following output: yypasswd then do ps -ef | grep yypasswd | awk ‘{print $8}’ if you want the following output: testacc 25124194 2512312620 0 08:00:53 pts/0 0:00 then do ps -ef | grep yypasswd | awk ‘{print $1, $2, $3, $4, $5, … Read more

[Solved] Arithmetic operations using numbers from grep

Assumptions: we want to match on lines that start with the string number we will always find 2 matches for ^number from the input file not interested in storing values in an array Sample data: $ cat file.dat number1: 123 not a number: abc number: 456 We’ll use awk to find the desired values and … Read more