How can I enable the auto-complete feature with the TAB key?

Posted on 2004-11-02
Last Modified: 2013-12-27
How can I enable the auto-complete feature with the TAB key?
Does this depend on the shell?
I use Korn or C shell.
Question by:iamjhkang
    LVL 38

    Accepted Solution

    ksh and C shell does NOT have such feature!

    ksh can complete pathnames with a little bit more complicated sequence.

    set -o vi        # set ksh input editor = vi
    you can put this statement in your .profile file to get it automatically executed

    type a partial pathname
    press <esc> to go in command mode
    press =   to get a list of pathnames that complete your partial pathname OR
    press *    to expand your partial pathname to the complete list of completing pathnames

    and you can do "vi" style commandline search for command history.

    IF you want TAB completion, use tcsh shell.

    LVL 10

    Expert Comment

    tcsh --- YUCK !!!!!!!

    Use bash .... Much better shell ... IMHO ;)
    LVL 2

    Expert Comment

    The bash shell gives you the tab-key auto-complete feature, and another selling point is that it is commonly used on Linux systems, which means that many people have experience of using it.

    "bash" was shipped as part of Solaris from Solaris 8 onwards.

    To switch to bash immediately, type "bash" (and "exit" to go back to your normal shell)

    To switch to bash permanently, you need to change your default shell - "usermod -s /bin/bash <username>"

    LVL 48

    Expert Comment


    You forgot <esc>\
    for ksh filename completion.

    LVL 38

    Expert Comment

    Good point  Tintin, thanks!
    LVL 1

    Author Comment

    in ksh,
    typing some letters and typing twice "esc" makes auto-completion.

    to do that how can I set configuration?
    LVL 38

    Expert Comment

    after you typing something, type <Esc> once and then follow by a \ key.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. Please see for the updated article. It is avail…
    Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap ( Version 1.2 2.      Jpcap( Version 0.6 Prerequisite: 1.      GCC …
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now