Hamilton LaboratoriesHamilton C shell 2012User guideTutorials

Filename completion

Oregon Coast

Filename completion
Previous | Next

Topics

Filename completion
See also

Filename completion

Filename completion is another “creature comfort:” you type just a fragment of a filename and let the shell fill in the rest. There are three variations: using the Tab key to walk one-by-one through the list of matches, Ctrl-F to expand only as much as is common to all the matches and Ctrl-D to paste in all the matches all at once.

Tab

Next match. Show the new match in the list of filenames that match the wildcard, replacing the previous match. After the last match, put the original string back up, highlighting it in bright red, then continue cycling through the list again.

Shift-Tab

Previous match. Same as the Tab key, but rotate backward through the list of matches.

Ctrl-F

Filename completion. Look for a filename that starts with preceding characters. If it matches a single file, fill in the rest of the name. If more than one file matched, show the part that was the same for all, highlighted in green. (Bright red means there were no matches at all.)

Ctrl-D

Duplicate completions. Paste all the matching filenames onto the command line, one after the other with spaces between.

Since Tab is normally bound to the filename completion function, the regular tab character is typed instead as Ctrl-Tab. If you’d prefer to have the Tab key be the regular tab character and Ctrl-Tab be filename completion, invoke the C shell with the -T option.

Filename completion is done with wildcarding, pasting an * onto the end of the previous word and then looking for any matches. Unlike cmd.exe, Hamilton C shell does any wildcarding before executing the command you type. It uses a powerful recursive pattern match algorithm that guarantees sensible matches even if you type a very complex pattern. Wildcarding is the subject of a whole chapter up ahead.

See also

Filename completion
Command line editing
Command completion
History recall
Tutorial: Command line editing
Tutorial: History

Previous | Next

Getting started with Hamilton C shell

Hamilton C shell, as it first wakes up.

Getting started with Hamilton C shell

A first few commands.

You can set the screen colors to your taste.

You can set the screen colors to your taste.