Entering commands

Filename completion

To turn on filename completion set the shell variable filec:

   set filec

Then to complete a file or directory name press the ESC key.

   ls -l on<ESC>line_help

If the filename is not completed enter more characters until the filename can be uniquely identified.

Matching file names with regular expressions

You can use the following metacharacters to create regular expressions that match file names.

   ?       matches any single character
   *       matches any number of any characters
   [nnn]   matches any of the enclosed characters
   [!nnn]  matches any character that is not enclosed
   [n-n]   matches any character in this range

To list all files with a particular extension:

   ls *.fm

This will list all the files in the current directory that have the extension .fm.

To remove a range of files:

   rm prog.?

This removes all the files in the current directory with a single character extension to their name. Files foo.c and foo.o would be removed as would file foo.3.

To copy all the files containing the same pattern:

   cp [pP]art[0-9] ../book

This copies all files whose name contains a pattern that starts with either p or P followed by the letters art and ending in any number from 0 through to 9.

So the file part1 would be copied to the parent directory book as would the file Part7.