9.8 Filename Completion: Faster Filename TypingIf you hate typing long filenames, you should know about the shells' "filename completion" feature. It varies shell-to-shell, so we'll give an overview here. Check the manpage or the shell's Nutshell Handbook for details. You can type the initial part of a filename, and then press the TAB key (in the C shell, use ESC). If the shell can figure out the complete filename from the part that you've typed, it will fill in the rest of the name. If not, it will fill in as much of the name as is unambiguous, and then let you type some more. (To enable this in most C shells, set the variable filec ( 6.9 ) or complete . Older C shells don't have this feature.) For example:
$ (With tcsh and csh , your terminal will beep if more than one file matches the name you've typed. If all this beeping drives you crazy, you can set the nobeep shell variable; that will turn it off.) In this case, only one filename begins with b , so the shell can fill in the entire name. If you type part of a filename and then type CTRL-d (in bash , type TAB twice), the shell lists all the files that match whatever you've typed. It then redisplays your command line and lets you continue typing. For example:
% Two files begin with the letter "a"; the shell lists them. It then redisplays the cc command, letting you finish the filename.
Article 14.9 shows an interesting shortcut to filename completion: cd ing to a directory by typing its "initials." - , |
|