Time field showing Zero in ps command output


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Time field showing Zero in ps command output
# 1  
Old 05-04-2015
HP Time field showing Zero in ps command output

Code:
  F S      UID   PID  PPID  C PRI NI             ADDR   SZ            WCHAN    STIME TTY       TIME COMD
401 S   catmgr  5748  5742  0 154 20 e0000006d48cd080  133 e0000003fb6e7200 11:22:32 ?         0:00 /opt/ssh/libexec/sftp-server
3401 R   catmgr  5742  5631  0 152 20 e0000005f974fa00  750                - 11:22:31 ?         0:00 sshd: catmgr@notty
421 T   catmgr 14751 18253  0 186 24 e000000685a6c380  327                - 09:33:57 pts/14    0:00 ksh cat_Duplicate_Records_Removal.ksh
421 T   catmgr  3495 18253  0 158 24 e0000009ceca7080  327                - 09:30:09 pts/14    0:00 ksh cat_Duplicate_Records_Removal.ksh
3401 S   catmgr  9317  9152  0 154 20 e000000654b27400  622 e0000003fb6e7080 04:50:51 ?         0:00 sshd: catmgr@notty
1401 T   catmgr  4091     1  0 152 24 e0000005a6abf700  624                -  Apr 23  ?         0:00 ssh catmgr@g4u1993c.houston.hp.com ksh /DI_Data_HU1/infa_shared/cat/CODE/sh/Reporting_Jobs.sh
401 S   catmgr  9558     1  0 158 20 e0000008ae70ad00  331 e00000063bfa4980 09:44:39 ?         0:00 ksh Reporting_Jobs.sh


I am using HP-ux

I dont know why the time field is shown as 0:00 for running process and why '?' is shown for tty field.

anyone please shed some light on this..

thank you
# 2  
Old 05-04-2015
The ? means the process is not connected to a controlling terminal.
Since computers are very fast and ps has limited number of significant digits, some small values are rounded down to 0.00.

For example a process could have .004 seconds of actual cpu usage, which would display as 0.00 Any process that shows in ps has to have used at least a tiny bit of cpu to have been created.

Do you have a problem you are trying to solve?
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 05-04-2015
Quote:
Originally Posted by jim mcnamara
The ? means the process is not connected to a controlling terminal.
Since computers are very fast and ps has limited number of significant digits, some small values are rounded down to 0.00.

For example a process could have .004 seconds of actual cpu usage, which would display as 0.00 Any process that shows in ps has to have used at least a tiny bit of cpu to have been created.

Do you have a problem you are trying to solve?

yes i have a problem.(I started playing around with PS becasue of the below issue). Can you please suggest an alternative method for 'disown' command as its not supported in my HP-UX
Korn Shell script in stopped state while running in background
# 4  
Old 05-04-2015
disown builtin is in ksh93. HP-UX 11.31 and older have ksh88.
Workaround is closing or redirecting all the file handles, at minimum stdin(0), stdout(1), stderr(2).
TIME is accumulated CPU usage. Actual CPU usage is PCPU.
You can display all the times with this:
Code:
UNIX95=1 ps -eo pid,user,time,etime,stime,pcpu,args

Average CPU consumption is the quotient (time / etime), (CPU time / Elapsed time).
The stime is an absolute time of the process start, usually less precise than (current_time - etime).
This User Gave Thanks to MadeInGermany For This Post:
# 5  
Old 05-13-2015
Quote:
Originally Posted by TomG
Code:
  F S      UID   PID  PPID  C PRI NI             ADDR   SZ            WCHAN    STIME TTY       TIME COMD
401 S   catmgr  5748  5742  0 154 20 e0000006d48cd080  133 e0000003fb6e7200 11:22:32 ?         0:00 /opt/ssh/libexec/sftp-server
3401 R   catmgr  5742  5631  0 152 20 e0000005f974fa00  750                - 11:22:31 ?         0:00 sshd: catmgr@notty
421 T   catmgr 14751 18253  0 186 24 e000000685a6c380  327                - 09:33:57 pts/14    0:00 ksh cat_Duplicate_Records_Removal.ksh
421 T   catmgr  3495 18253  0 158 24 e0000009ceca7080  327                - 09:30:09 pts/14    0:00 ksh cat_Duplicate_Records_Removal.ksh
3401 S   catmgr  9317  9152  0 154 20 e000000654b27400  622 e0000003fb6e7080 04:50:51 ?         0:00 sshd: catmgr@notty
1401 T   catmgr  4091     1  0 152 24 e0000005a6abf700  624                -  Apr 23  ?         0:00 ssh catmgr@g4u1993c.houston.hp.com ksh /DI_Data_HU1/infa_shared/cat/CODE/sh/Reporting_Jobs.sh
401 S   catmgr  9558     1  0 158 20 e0000008ae70ad00  331 e00000063bfa4980 09:44:39 ?         0:00 ksh Reporting_Jobs.sh


I am using HP-ux

I dont know why the time field is shown as 0:00 for running process and why '?' is shown for tty field.

anyone please shed some light on this..

thank you

I believe this link will be of some use

The UNIX School: ps command : what does the TIME indicate?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Send output of time command to file

I am measuring the time it takes for a wget command to complete. Right now my command is: time wget https://`ifconfig -a | grep '32.29.120' | cut -d: -f2 | cut -d' ' -f1`:8443/primary-rest/shop?brandId=test --header="name: test" --no-check-certificate -o SELF_TEST.log The output I get is ... (2 Replies)
Discussion started by: Junaid Subhani
2 Replies

2. Shell Programming and Scripting

Use bash command on awk field and output the result

Hello, I want to run a field from an awk command through a command in bash. For example my input file is 1,2,3 20,30,40 60,70,80 I want tot run $2 thought the command date +%d/%m/%y -d"01/01/15 + $2 days -1 day" and get the output 1,02/01/15,3 20,30/01/15,40 60,11/03/15,80 ... (2 Replies)
Discussion started by: garethsays
2 Replies

3. UNIX for Dummies Questions & Answers

Command showing no output!

Hi Folks, I have a situation here, where no command is giving any output, and it's not even showing any error message also. What could be the reason? (3 Replies)
Discussion started by: nixhead
3 Replies

4. Solaris

Find command output gives one day before time stamp

Hi All, I am listing the files which are 4 hours older. For this first I have creted a dummy file with the 4 hours before timestamp, then I am using the below find command, find /path/ -type f ! -newer 4_hours_oledr_file -exec ls -lrt {} \; I am getting the files which are older than... (13 Replies)
Discussion started by: velava
13 Replies

5. Shell Programming and Scripting

Grep command showing wrong output in Linux

Hi All I am trying to run a script in linux wherein i have a command like this grep ^prmAttunityUser= djpHewr2XFMAttunitySetup_ae1_tmp djpHewr2XFMAttunitySetup_ae1_tmp is a temporary file in which the user value is stored but this command in the script returns me balnk value whereas it has a... (4 Replies)
Discussion started by: vee_789
4 Replies

6. UNIX for Dummies Questions & Answers

how to avoid time command output

Hi, I have 2 queries 1 .when I run some unix command, I am getting the output of "time" at std output (screen) for eg zegrep <pattern> *.v.gz I almost found the reason but not sure, if the no of files matching *.v.gz is more then I am getting the time command output at the... (5 Replies)
Discussion started by: selvaka
5 Replies

7. Shell Programming and Scripting

Sorting on two fields time field and number field

Hi, I have a file that has data in it that says 00:01:48.233 1212 00:01:56.233 345 00:09:01.221 5678 00:12:23.321 93444 The file has more line than this but i just wanted to put in a snippet to ask how I would get the highest number with time stamp into another file. So from the above... (2 Replies)
Discussion started by: pat4519
2 Replies

8. Linux

Process start time not showing correct time

Process start time is not showing the correct time: I had started a process on Jun 17th at 23:30:00. Next day morning when I run the command "ps -ef | grep mq", the process is showing the start date of Jun 17th but the start time is 00:16:41 Day/Date is setup correctly on the server. It... (2 Replies)
Discussion started by: hemangjani
2 Replies

9. UNIX for Dummies Questions & Answers

ps command - time field

Hi all, Can someone extending on what the time field is explaining in a ps command. Man page only has this: time The cumulative execution time for the process. Is this a combined CPU time? if that is the case then it should be impossible to have a 00:00 time on any process. ... (1 Reply)
Discussion started by: nhatch
1 Replies

10. UNIX for Advanced & Expert Users

output of the time command ?

can someone tell me the meaning of this commnad, If you want to see a grand total of CPU time for a program when it finishes running, you can use the time command. At the Unix prompt, enter: time java myprog Replace myprog with the name of the program you are running. The following is an... (2 Replies)
Discussion started by: ldpathak
2 Replies
Login or Register to Ask a Question