The Hidden PS
1
|
While going through the source code for the well known ps command, I read about some interesting things.. Namely, that there are a bunch of different fields that ps can try and enumerate for you. These are fields I was not able to find in the man pages, documentation, only in the source.
Here is a longer function that goes through each of the formats recognized by the ps on your machine, executes it, and then prompts you whether you would like to add it or not. Adding it simply adds it to an array that is then printed when you ctrl-c or at the end of the function run. This lets you save your favorite ones and then see the command to put in your .bash_profile like mine at : http://www.askapache.com/linux-unix/bash_profile-functions-advanced-shell.html
Note that I had to do the exec method below in order to pause with read.
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
* View this command to comment, vote or add to favourites * View all commands by AskApache
commandlinefu.com
by David Winterbottom (codeinthehole.com)
Gmail Twitter Facebook Delicious Tumblr 1 person recommended this
Related Articles:
- 2010/11/13 Firesheep addon allows the clueless to hack Facebook, Twitter over Wi-Fi
- 2010/11/07 Skyline with Red color – from mobile.
- 2010/10/02 [Solved] Abbreviations not working in vim
- 2010/09/30 Free Calendar for October 2010
- 2010/06/25 Twiiter from Pidgin on Fedora 11 -Leonidas
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.