| How to find out the time I executed a command previously
on UNIX Solaris?
To be more specific and more clear about what I want to know is
that I want a command the enables me to know the history and which command
I run at this history/time.
FYI I used the following command but it did not work with me:
#export HISTTIMEFORMAT=`%F %T`
Answer:
Code:
# export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S"
or (equal)
Code:
# export HISTTIMEFORMAT="%F %T "
and results
Code:
# history
36 2011-04-13 23:55:19 history
37 2011-04-13 23:55:22 history
Code:
# export HISTTIMEFORMAT="%a %b %d %H:%M:%S %Y "
Code:
# history
36 Çar Nis 13 23:55:19 2011 history
37 Çar Nis 13 23:55:22 2011 history
Note:
BASH
Code:
# export HISTTIMEFORMAT="%F %T "
# history
1001 2011-04-18 23:21:22 history
1002 2011-04-18 23:21:30 export HISTTIMEFORMAT="%F %T "
1003 2011-04-18 23:21:32 history
KSH
Code:
# PS1='$(date "+%F %T"|read -s)# '
# history | sed '$!N;s/^\([0-9][0-9]*[\t ]*[0-9][0-9]*-[0-9][0-9]*-[0-9][0-9]*.*\)\n[0-9][0-9]*
*\(.*\)/\1 \2/'
602 2011-04-18 23:22:01
ls
604 2011-04-18 23:22:05
ls -l
606 2011-04-18 23:22:07
history
TCSH
Code:
# set history= ( 1500 "%h %Y-%W-%D %P %R\n" )
# history
14 2011-04-18 23:23:17 ls -l
15 2011-04-18 23:23:20 history
Have a Unix Problem
Do you have
a UNIX Question?
Unix Books :-
UNIX
Programming, Certification, System Administration, Performance Tuning Reference
Books
Return to : - Unix
System Administration Hints and Tips
(c) www.gotothings.com All material on this site is
Copyright.
Every effort is made to ensure the content integrity.
Information used on this site is at your own risk.
All product names are trademarks of their respective
companies.
The site www.gotothings.com is in no way affiliated
with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.
|