1751802 Members
5324 Online
108781 Solutions
New Discussion юеВ

view last command

 
madhudeepan
Frequent Advisor

view last command

how to see the list of commands that are executed before after exiting from a particular server
6 REPLIES 6
Michal Kapalka (mikap)
Honored Contributor

Re: view last command

hi,

check the history file if it's defined or activate auditing/accounting.

histfile are defined mostly sh_history,

$home/.profile

export PS1=`hostname`:'$PWD>'
export HISTFILE=./.sh_history
export HISTSIZE=2048

Jestin John Chacko
Regular Advisor

Re: view last command

Dear,

please check this link

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1337388

Hope this will help you....
Michael Schon
Advisor

Re: view last command

# ksh
# set -o vi

Press Esc and k or j
R.K. #
Honored Contributor

Re: view last command

Hello,

You can try:
# history -10

to list last 10 commands.

-R.K.
Don't fix what ain't broke
R.K. #
Honored Contributor

Re: view last command

Also if your .sh_history is set as said in the first answer to your thread.

# more /.sh_history

-R.K.
Don't fix what ain't broke
24 7
Occasional Advisor

Re: view last command

if history is enabled, press escape k

to search escape / and to move cursor use vi commands. all vi keys will work with ksh.
Happy are those conscious About their Spiritual need.