PS -ef ??


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers PS -ef ??
# 15  
Old 12-28-2011
Quote:
Originally Posted by methyl
Clearly the output format from this GNU/Linux version of "ps" is different from the default unix output format.
Actually not having a space character between Month and Day is so much better ! (It's a pain in unix).

Just for completeness it would be nice to see a sample for processes started today.
Small sample of processes started "today" from my laptop:
Code:
UID        PID  PPID  C STIME TTY          TIME CMD
postfix   4716  4122  0 10:12 ?        00:00:00 pickup -l -t fifo -u
scooter   5515     1  0 10:40 ?        00:00:00 xterm -fn 5x8 -ls -vb -aw -n 5512 -T 5512:  -fg #00c0ff -bg black -geometry 80x30++107+32 -sb /usr/common/ast/bin/ksh
scooter   5517  5515  0 10:40 pts/5    00:00:00 -ksh
scooter   7245  4442  0 11:39 pts/0    00:00:00 ps -ef

Quote:
Originally Posted by rbatte1
I can't say that a huge long grep -v is really the best way to approach this given that you may inadvertently match so many things, but then if it works, then I suppose that's all we all want.
Robin
I agree completley -- If it were me I'd go with the 'hack' -- might be more of a maintenance headache if porting is needed, but it yields predictable results and doesn't match a command with a date string in it either.
This User Gave Thanks to agama For This Post:
# 16  
Old 12-28-2011
Thank you.
This GNU/Linux version of "ps" has the start time as HH:MM and the CPU time as HH:MM:SS , whereas the unix version of "ps" has the start time as HH:MM:SS and the CPU time as MM:SS .
That's why the grep ':..:' worked in unix but not in GNU/Linux.
# 17  
Old 12-28-2011
An alternative, as per requirement in post #5.
Code:
ps -ef | awk '$5 ~ /[0-9][0-9]:[0-9][0-9]/ {print}'

I tried this on Ubuntu 11.10 (GNU Bash 4.2.10).
 
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question