Results 1 to 4 of 4
Hi,
Is there a way in which we can identify the time a particular command has been executed (from the history file).
Thanks in Advance.
Raghu....
- 02-03-2009 #1Just Joined!
- Join Date
- Mar 2006
- Posts
- 4
Finding time when a command has been executed
Hi,
Is there a way in which we can identify the time a particular command has been executed (from the history file).
Thanks in Advance.
Raghu.
- 02-03-2009 #2Just Joined!
- Join Date
- Feb 2009
- Posts
- 12
For example, to see the last time the 'cp' command was used,Code:stat /path/to/file
Of course, this only works if you have atime enabled, which most distros do by default.Code:stat /bin/cp
- 02-03-2009 #3
Not by default. Some programs do write in the log files (browse /var/log).
There are some ways to install such a facility, of course. For example, you could re-alias certain commands so that they first invoke a log entry (Program $prg has been executed at $time by %username) and then do run the actual program.Debian GNU/Linux -- You know you want it.
- 02-10-2011 #4Just Joined!
- Join Date
- Feb 2011
- Posts
- 1
hi,
can u please tell me how can this be done.
I m new to linux n know very few things about it


Reply With Quote