Saturday, April 7, 2007

pgrep vs ps

[root@localhost X]# pgrep -d, -u root
1,2,3,4,5,18,28,29,31,19,30,105,181,190,1002,1475,1811,1815,1890,1958,2035,2066,2108,2123,2142,2161,2216,2326,2331,2342,2352,2401,2468,2534,2535,2536,2671,2820,2826,2958,2986,3019,3020,3025,3028,3030,3032,3038,3070,3074,3076,3078,3080,3082,3084,3086,3088,3097,3101,3143,3145,3147,3149,3151,3152,3153,6209,6213,6215,6217,6223,6225,6227,6232,6239,6449,6482,6483,6490,6491,6498,6499,6500,6501,6505,6506,6513,6536,6576,6583,6590,6595,6597,6600,6644
[root@localhost X]# ps -ef | egrep '^root ' | awk '{print $2}' | awk '{printf("%s,",$1)}'
1,2,3,4,5,18,28,29,31,19,30,105,181,190,1002,1475,1811,1815,1890,1958,2035,2066,2108,2123,2142,2161,2216,2326,2331,2342,2352,2401,2468,2534,2535,2536,2671,2820,2826,2958,2986,3019,3020,3025,3028,3030,3032,3038,3070,3074,3076,3078,3080,3082,3084,3086,3088,3097,3101,3143,3145,3147,3149,3151,3152,3153,6209,6213,6215,6217,6223,6225,6227,6232,6239,6449,6482,6483,6490,6491,6498,6499,6500,6501,6505,6506,6513,6536,6576,6583,6590,6595,6597,6600,6644

No comments:

Related Titles

 
visitors since March 26 2007
©2007