1833793 Members
2340 Online
110063 Solutions
New Discussion

Shell Command History

 
oradba
Occasional Contributor

Shell Command History

I am using Korn shell.

- when opening a new Xterm window, I am unable to access the shell history

- what is the option to set the length of the command history.

thanks
abhay
5 REPLIES 5
Pete Randall
Outstanding Contributor

Re: Shell Command History

Try this:

export HISTFILE=/tmp/.sh_history.$(whoami)

Pete

Pete
Sridhar Bhaskarla
Honored Contributor

Re: Shell Command History

Hi Abhay,

HISTFILE=~/.sh_history

This will set your history file.

HISTSIZE=400

This will set your history depth to 400 commands.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Robert-Jan Goossens
Honored Contributor

Re: Shell Command History

Hi,

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

Robert-Jan.
Chris Wong
Trusted Contributor

Re: Shell Command History

Make sure your .dtprofile has: DTSOURCEPROFILE=true

The settings that are probably in your .profile are:
HISTFILE=$HOME/.sh_history
(should not be in /tmp as this allows all users to read)
HISTSIZE=some number

- Chris
Martin Johnson
Honored Contributor

Re: Shell Command History

Also verify your EDITOR variable is set:

EDITOR=vi; export EDITOR

HTH
Marty