Directory

Encyclopedia

NodeWorks
                              ENCYCLOPEDIA

Link Checker

Home
Encyclopedia : T : TA : TAB :

Tab completion

 

Tab completion

Tab completion is a function of many command line interfaces, especially Unix shells, that allows portions of an incomplete filename or commandss to be filled in when the Tab key is pressed. If the entered text is unambiguous, the filename will be fully completed. Therefore, in a directory with only one file whose name starts with "x", entering x [Tab] will produce that filename. Otherwise, the common characters in the name will be given.

For example, a directory may contain the files:

  • Contents_01
  • Contents_02
  • Contents_11
  • Contents_11_Draft_1
  • Contents_11_Draft_2

If a user enters just C [Tab], the shell will complete up to the first point of difference in the filenames, which is Contents_. At this point, the user has two options:

  • More characters can then be filled in, and tab completion invoked in order to get the desired file's name. To access the file Contents_11_Draft_1, the user needs only to key C [Tab] 1 1 _ [Tab] 1, keeping the number of keystrokes needed to find any file to a minimum.
  • Pressing the Tab key again will show a list of files that match the already-given characters, in this case all of the above list. If the list of possible options for completion is great, the shell will ask the user whether or not to display them in order to keep from overloading the machine. This is especially important in large folders, such as /usr/bin.

    Completion in Microsoft operating systems

Originally, MS-DOS did not feature tab completion. Pressing the Tab key would output an actual tab space. Before the release of Windows, various enhanced shells for MS-DOS such as 4DOS would feature Unix-style tab completion.

In 4DOS, tab completion worked a bit differently. After pressing Tab, the full name of the first matching file appears. Each successive Tab displays the next match, and further characters can be entered to narrow the search. Tab completion is supported in Windows XP's cmd.exe in this way as well.


NodeWorks boosts web surfing!
Page Returned in 0.355 seconds - HTML Compressed 67.9%

This article is from Wikipedia. All text is available
under the terms of the GNU Free Documentation License.
 GNU Free Documentation License
© 2008 Chamas Enterprises Inc.