cancel
Showing results for 
Search instead for 
Did you mean: 

how to see histroy file

Aungshuman Paul
Regular Advisor

how to see histroy file

Hi,

Can anyone help me regarding history file in hp-ux 11i v3? Like linux how can I see history file for last all executed command?

Aungshu
8 REPLIES
Robert-Jan Goossens
Honored Contributor

Re: how to see histroy file

Hi Aungshu,

# ksh -o vi
Esc-k

or
# strings $HOME/.sh_history

Regards,
Robert-Jan
Aungshuman Paul
Regular Advisor

Re: how to see histroy file


Hi,

When I type the following command it prompt :

# strings $HOME/.sh_history
//.sh_history: No such file or directory

Please suggest.

Aungshu
Robert-Jan Goossens
Honored Contributor

Re: how to see histroy file

Hi again,

What kind of shell does your user have (ksh,bash,csh)?

# su - user
# echo $HISTFILE

Robert-Jan

Aungshuman Paul
Regular Advisor

Re: how to see histroy file

My shell is ksh. And echo $HISTFILE reply nothing. NO variable set.And I try to see the history file from root user.

Aungshu
Robert-Jan Goossens
Honored Contributor

Re: how to see histroy file

Hi,

Have a look at this doc.

http://docs.hp.com/en/B2355-90046/ch20s03.html

Regards,
Robert-Jan
點燃
Valued Contributor

Re: how to see histroy file

Have you tried #history -100 and #fc -l ,commands?

regards!
Man's mind, once stretched by a new idea, never regains its original dimensions
Bill Hassell
Honored Contributor

Re: how to see histroy file

> My shell is ksh. And echo $HISTFILE reply nothing. NO variable set.And I try to see the history file from root user.

The ksh shell will not create the .sh_history file for the root user automatically. You must also set two variables in /etc/profile:

export HISTFILE=$HOME/.sh_history
export HISTSIZE=2000

Then as root, run the command:

touch $HOME/.sh_history

Then login again and your shell history will begin working.


Bill Hassell, sysadmin
Suraj K Sankari
Honored Contributor

Re: how to see histroy file

HI,
Are you using root (Super User) account or a normal user.

Suraj