Completion is invoked when you type either of the two control characters. The completion function takes the path string to ...

Completion is invoked when you type either of the two control characters.  The completion function takes the path string to the left of the cursor appends a wild card character to it if none is already present and builds up a list of paths that match.  It then displays the first matching path.  If no paths match, it just beeps and leaves the display alone.  Thereafter, repeated pressing of the same control character will cycle through the list of matching paths.  Pressing the Shift key with the control character will move through the list backwards.  If you edit the line in any way and press the control character again, the saved list of matching paths is discarded and a new one generated.  The same occurs if you switch between file and directory name completion.  The only difference between the two control characters is the file completion character matches both file and directory names, while the directory completion character only matches directory names. If file completion is used on any of the built in directory commands (CD, MD or RD) then directory completion is assumed.  The completion code deals correctly with file names that contain spaces or other special characters by placing quotes around the matching path. Also, if you back up, then invoke completion from within a line, the text to the right of the cursor at the point completion was invoked is discarded.  The special characters that require quotes are:            ()[]{}^=;!%'+,`~