How Long a process runs for ?

Mario Vukelic mario.vukelic at dantian.org
Sat Sep 22 14:19:42 UTC 2007


On Sat, 2007-09-22 at 09:50 -0400, Rick wrote:
> There a app, I used in the Terminal window, I know it does take a few hours to 
> run, however... I would like to know exactly how long so I could setup a cron 
> job.
> 
> Is there a way to find out how long a application ran for ?


In general, you can use the "time" command to run another program. When
the program exits, times prints the resource usage. See the man page for
time.

I suspect, however, that there are smarter ways to achieve what you want
-- but I have no experience with this. Maybe the audit subsystem in the
kernel can help? See the package description for auditd and go from
there.

> also it would be nice, if my terminal window would display the current date 
> and time in the window before the flashing cursor.

Edit /etc/bash.bashrc for system-wide configuration, or ~/.bashrc for
just your own account. There are already prompts defined in these files.
Use them as examples and adapt to your needs. You can look up the
available field codes in "man bash" under the heading, "PROMPTING"





More information about the ubuntu-users mailing list