Author Topic: Korn Shell Command History and Autocomplete  (Read 1745 times)

Offline scotbuff

  • Sys Admin
  • UNIX User
  • *****
  • Posts: 174
  • Karma: +2/-0
    • View Profile
    • Scott.Buffington.me
Korn Shell Command History and Autocomplete
« on: January 08, 2006, 09:41:15 am »
Those who are new to the Korn shell often complain about not having command history or most often, autocomplete.  Both features are available within the Korn shell. 

Most if not everyone knows to put the setting - set -o vi in your .profile or just run that command from the command line when you sign in.  This gives you the Esc k command history and vi line editing.  For emacs fans you replace the vi with emacs. 

What is less known is that using Esc followed by \ will give you autocomplete when you are using the vi editing mode.  When using the emacs editing mode with the Korn shell the Esc key pressed twice handles your autocomplete.  I have noticed on some systems that either sequence works, I can only imagine this has something to do with when and how the set -o vi command was entered.

example:
comet:/home/sbuffing > cd /usr/Web <Esc> <\> A <Esc> <\>
comet:/usr/WebSphere/AppServer >


Autocomplete is most useful when moving and copying files, it is much better to fully qualify all commands rather than wild carding.
« Last Edit: April 02, 2007, 10:57:38 am by scotbuff »