How to scroll back and forwrd in HP-UX?

How to scroll back and forwrd in HP-UX?

1.How to auto complete commands in HP-UNIX, which key should be used as in Linux "tab" key is being used.
2. How to scroll back and forward in HP-UX ; in Linux we use up and down arrow.:confused::confused::confused::confused:

After installing HP-Unix you will notice that the command history is not working. That is pressing Esc+k returns nothings. If you execute the history command you will see error message like this:
sh: fc: Cannot access or open the history file.
You have to manually enable this feature. To do this add the following two line on your ~/.profile file and create the .sh_history file using touch command. Then log in again. You will see it is working.
HISTFILE=$HOME/.sh_history
export HISTFILE

source

After having set correctly your .profile (or .kshrc...), filename completion is done by using the Esc key twice, the back an forth in command history uses Esc+k or j (like in vi...)

1 Like

Within your .profile make sure that you have the $HISTFILE environment variable set and exported (see above) and one or both of these two possible lines:

VISUAL=vi ; export VISUAL
EDITOR=vi ; export EDITOR

Then you can use the keystroke sequence <esc>/k to present the last command typed for editing. Move backwards or forwards through the command history using the "-" or "+" keys respectively. If you find a command you want to edit, type "v" which will invoke "vi". Then after editing, use the usual ":wq!" to exit vi and the edited command will execute.
Tip: If you decide to not execute any command (edited or not), blank the command in vi (eg. the "dd" vi command) and then ":wq!".