1820695 Members
3684 Online
109627 Solutions
New Discussion юеВ

History Command in HPUX

 
panks
Regular Advisor

History Command in HPUX

How can I check the history of command I fired !! Like in other unix history command is ther.

Pls guide
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: History Command in HPUX

Shalom,

env | grep HIST

If HISTFILE is set thats where command line history will be. Note this can't be NFS, it won't work.

If its not set, set it in the /etc/profile for the whole system.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
TTr
Honored Contributor

Re: History Command in HPUX

Search in this forum for "command history". There are many threads.

Depending on what kind of shell you are using, there are different ways and places to set it up and different ways to use it (recall the previous commands).
Dennis Handly
Acclaimed Contributor

Re: History Command in HPUX

>SEP: If HISTFILE .... Note this can't be NFS, it won't work.

In the past there were ksh hangs if HISTFILE was over NFS. I heavily depend on that to have a shared history file for 17 shells and various machines.
If you have the right NFS patches, it works.
You do have to be careful for different OS versions and when the count gets past 64K, bad things happen ...
Jeeshan
Honored Contributor

Re: History Command in HPUX

or use "man history" for details info.
a warrior never quits
Dennis Handly
Acclaimed Contributor

Re: History Command in HPUX

>ahsan: or use "man history" for details info.

I get an empty gnu page from 2003.
Since history is a shell builtin, you'll need to look at your shell's man page.
ln_unix
Frequent Advisor

Re: History Command in HPUX

1) history command

$history
or
man history (for help)

2)If u r using POSIX shell, then can also use

cat .sh_history


panks
Regular Advisor

Re: History Command in HPUX

Thanks