Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

File name generation

&pagelevel(4)&pagelevel

After these various substitutions, each word is examined for the presence of an asterisk *, question mark ? or left-hand square bracket [. However, this examination is only performed if the option -f (see set) has not been set. If one of these characters is found in a word then the word is considered as a pattern. The word is then replaced by lexicographically sorted file names which match the pattern. If no matching file name is found for the pattern then the word is retained unchanged.

If you use patterns for file name generation you must pay special attention to the characters period . and slash /: a period at the start of a file name or immediately after a /, as well as / itself must match explicitly. The special handling of these characters does not apply to other substitutions.


*matches any string, including the null string.
?matches any string, including the null string.
[...]matches any one of the characters enclosed within the square brackets.
A pair of characters separated by a dash (-) matches any character lexically between the pair, inclusive. A dash can be included in the set of characters to be matched as long as it is the first or last character. If the first character following the left bracket is a an exclamation point, the enclosed set of characters is negated: any character not enclosed is matched.


A pattern list is a list of one or more patterns separated from each other by a | (vertical bar). Composite patterns can be formed with one or more of the following constructs:

?(pattern-list)

Optionally matches any one occurrence of the given patterns.

*(pattern-list)

Matches zero or more occurrences of the given patterns.

+(pattern-list)

Matches one or more occurrences of the given patterns.

@(pattern-list)

Matches exactly one of the given patterns.

!(pattern-list)

Matches anything, except one of the given patterns.