The linux "ps" command is very useful as we all know. However, it just pains me when it strips off the larger commands.
Thus if you wanted to do something like
ps aux | grep "xxcommand"
it will only grep through the length that is fitted in the screen.
Thus if you have a command like the foll., no matches will be found:
xxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxcommand
What is the workaround? Use --columns along with ps to specify the number of columns that is outputted. Normally it defaults to tthe number of columns in the terminal leading to the above problem.
e.g.
ps aux --columns=1000 | grep "xxcommmand" ....and your o/p will be what you are seeking.
Peace with ps...
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment