Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

In Unix, how do I use filename completion?

Filename completion is a feature built into some Unix shells that allows you to type part of a filename or directory name and press a key to fill out the rest. In most shells, you can type only enough of the file's name to make it unique, and then press the Esc key to fill in the rest. Note the following:

  • This doesn't work in the sh shell.

  • In csh, to turn on filename completion, enter set filec .

  • In the tcsh or bash shell, press the Tab key instead of Esc to complete a filename.

For example, let's say you have the following files and subdirectories in your current directory:

./ .newsrc bin/ ../ .pinerc dead.article .cshrc .plan dead.letter .emacs Mail/ lynx_bookmarks.html .login News/ www/

To enter your bin subdirectory, you could type cd b , and then press the Esc key. The shell would complete the name, and you would see cd bin/.

Sometimes the shell will do a partial completion. The shell will fill in characters until it has to choose between two or more files. Continuing the example above, if you type more d and then press Esc, the shell will fill in only to more dead. , at which point you'll have to enter the next character of the file you want. This is because both dead.article and dead.letter start with a "d"; beyond dead. , the shell can't tell which file you want. Likewise, if you type emacs .p and then press Esc, the shell will not be able to fill in any more characters because the files .plan and .pinerc both begin with "p".

At Indiana University, for personal or departmental Linux or Unix systems support, see At IU, how do I get support for Linux or Unix?

This is document aids in domain all.
Last modified on August 22, 2008.

Comments/Questions/Corrections

Use this form to offer suggestions, corrections, and additions to the Knowledge Base. We welcome your input!

If you are affiliated with Indiana University and would like assistance with a specific computing problem, please use the Ask a Consultant form, or contact your campus Support Center.

Contact Information

Note: We will reply to your comment at this address. If your message concerns a problem receiving email, please enter an alternate email address.