

InterviewSolution
1. |
Solve : retrieve a previously entered command - Linux? |
Answer» I've attempted to determine how to retrieve a previously command . My experience is basically Windows/DOS command line using the arrow direction keys.. This saves a lot of extra typing... I've tried the arrow keys.. no success... I forgot to mention that I'm Maybe this will help... Code: [Select]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. http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1160294 Just a thought: Is your local machine running Windows or Linux? You may need to get the key mappings right. My local machine is running Windows (T42 laptop).. I thought about the key mapping but I suspect its the remote machine which is the issue here... Don't know ....Have you tried the history command, and the ESC / keys, and + and - ? The history command works.. the esc / key COMBINATION, the + and - do not.. At this point, with the history command, I guess the best way to repeat a cmd in the history list is using the r # cmd... |
|