[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] One liners are good for you



I love rattling through various one-liners trying to find the answer to
the question I'm looking for. I almost had by first-ever successful use
of -a, but not quite.

perldoc perlrun    is your friend. :)

j


 ps -ef | perl -nae 'print "$F[8]\n"' | more

 ps -ef | perl -pe 's/.*\d+:\d\d //;' | sort | uniq -c | more

 ps -ef | perl -ne '/.*\d+:\d\d (.*?) /; print "$1\n"' | sort | uniq -c
| more