tags:

views:

4411

answers:

2

In the Korn shell on AIX UNIX Version 5.3 with the editor mode set to vi using:

set -o vi

What are the key-strokes at the shell command line to autocomplete a file or directory name ?

+3  A: 

ESC\ works fine on AIX4.2 at least. One thing I noticed is that it only autocompletes to the unique part of the file name.

So if you have the files x.txt, x171go and x171stop, the following will happen:

Press keys:           Command line is:
x                     x
<ESC>\                x
1                     x1
<ESC>\                x171
g<ESC>\               x171go
paxdiablo
+2  A: 

Extending the previous answer: <ESC>* will list all matching files on the command line. Then you can use the standard vi editing commands to remove the ones you don't care about. So to add to the above table:

<ESC><shift-8>             x.txt x171 x171go

Then use backspace to go get rid of the last two, or hit <ESC> again and use the h or b to go backwards and dw to delete the ones you don't want.

Brian Deterling
Risky talking about the previous answer: order can change based on votes - a better solution would be to quote the previous and expand on it.
paxdiablo