Operating System - HP-UX
1820072 Members
2492 Online
109608 Solutions
New Discussion юеВ

how to show command history in SecureCRT

 
SOLVED
Go to solution
lancelot_fang
Occasional Contributor

how to show command history in SecureCRT

hi all:
I use SecureCRT to login , terminal is VT100.I try to show commond history by press ctrl + k , but I just saw ^k on the screen.
so what should i set in SecureCRT or ux ?

thanks
5 REPLIES 5
Dennis Handly
Acclaimed Contributor
Solution

Re: how to show command history in SecureCRT

On HP-UX it depends on your shell. In a real shell, you have the choice of vi or emacs editing: set -o vi OR set -o emacs
To get the previous line:
esc k (vi)
ctrl p (emacs)

I've heard that bash lets you use the arrow keys.
lancelot_fang
Occasional Contributor

Re: how to show command history in SecureCRT

I use vi as my editor , but it donst work when i press esc + k . Should I change some setting on SecureCRT?
Bill Hassell
Honored Contributor

Re: how to show command history in SecureCRT

No, SecurerCRT is just a dumb terminal emulator. The command history and recall features are part of your shell. ASSUMING your shell is /usr/bin/sh or /usr/bin/ksh, add these lines to /etc/profile (so all users will have this feature):

export HISTFILE=$HOME/.sh_history
export HISTLINES=2000
EXPORT EDITOR=/usr/bin/vi
set -o vi

Now login again and you'll see your command history. Useful commands:

history
history -20

history is an alias to fc -l and fc is a shell built-in command. man sh-posix or man ksh. You can type r ### where ### is the line number of a command line shown by history.

You can use ESC / to recall previous commands by searching for a string. Use + or - to move up and down once you have recalled a command.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: how to show command history in SecureCRT

>Bill: EXPORT EDITOR=/usr/bin/vi

Slight typo: export EDITOR=/usr/bin/vi
lancelot_fang
Occasional Contributor

Re: how to show command history in SecureCRT

thanks both of you ,Problem has been fixed !