You are not logged in.

#1 2014-01-01 10:01:43

Bailando
Member
From: Hungary
Registered: 2013-08-19
Posts: 133
Website

How can I obtain information about the recently finished commands?

How can I get information about the recently finished jobs / bash commands? (eg. date / time of termination)

Offline

#2 2014-01-01 10:52:53

vacant
Member
From: downstairs
Registered: 2004-11-05
Posts: 816

Re: How can I obtain information about the recently finished commands?

"man bash" see HISTTIMEFORMAT. That may get you near to where you want to be.

Offline

#3 2014-01-01 11:06:00

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: How can I obtain information about the recently finished commands?

@ vacant, while that will put a timestamp for each command executed, it won't help with finished commands.

@ Bailando, you'll probably have to play around with ps output.

Last edited by x33a (2014-01-01 11:07:16)

Offline

#4 2014-01-01 11:18:15

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How can I obtain information about the recently finished commands?

$ e echo foo
foo
$ type e
e is a function
e () 
{ 
    $@ && echo $@ - $(date) >> test.txt
}
$ cat test.txt 
echo foo - Wed Jan 1 12:10:54 CET 2014
$ e echo bar
bar
$ cat test.txt 
echo foo - Wed Jan 1 12:10:54 CET 2014
echo bar - Wed Jan 1 12:11:09 CET 2014
$ e htop

<here I do something with htop for a little while>

$ cat test.txt 
echo foo - Wed Jan 1 12:10:54 CET 2014
echo bar - Wed Jan 1 12:11:09 CET 2014
htop - Wed Jan 1 12:15:14 CET 2014

Last edited by karol (2014-01-01 11:20:36)

Offline

#5 2014-01-01 13:27:09

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: How can I obtain information about the recently finished commands?

Do you want to know how long a command is running?

time yourcommand

Offline

Board footer

Powered by FluxBB