File masks

Far Manager

File masks

File masks are frequently used in FAR commands to select a single file and/or folder or a group files and/or folders. Masks may contain common valid file name symbols, wildcards ('*' and '?') and special expressions:

ExpressionDescription
* Zero or more characters.
? Any single character.
[c,x-z] Any character enclosed in the brackets. Both lists and ranges of characters are allowed.

For example, files ftp.exe, fc.exe and f.ext may be selected using the mask f*.ex?, the mask *co* will select both color.ini and edit.com, the mask [c-f,t]*.txt will select config.txt, demo.txt, faq.txt and tips.txt.

In many FAR commands you may enter several file masks separated by commas or semicolons. For example, to select all the documents, you can enter *.doc,*.txt,*.wri in the "Select" command.

It is allowed to put any of the masks (in a list) in quotes (but not the whole list). For example, you have to do this when a mask contains any of the delimiting characters (a comma or a semicolon), so that the mask isn't confused with a list of masks.

In some commands (find files, file selection, file associations, sort groups and file highlighting) you may use exclude masks. An exclude mask is one or multiple file masks that must not be matched by the needed files. The exclude mask is delimited from the main mask by the '|' character.

Usage examples of exclude masks:

  1. *.cppAll files with the cpp extension.
  2. *.*|*.bak,*.tmp
    All files except for the files with bak and tmp extensions.
  3. *.*|
    This mask has an error - the character '|', is entered, but the mask itself is not specified.
  4. *.*|*.bak|*.tmp
    Also an error - the character '|' may not be specified in the mask more than once.
  5. |*.bak
    The same as '*|*.bak'