home | login | register | DMCA | contacts | help | donate |      

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
А Б В Г Д Е Ж З И Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Э Ю Я


my bookshelf | genres | recommend | rating of books | rating of authors | reviews | new | форум | collections | читалки | авторам | add



4.3.1.3. Ambiguous filenames

The wildcard characters ? and * can be used for pattern matching , which is useful for dealing with several files at a time without individually specifying each filename. ? will match any one character in a filename, and * will match any number of any characters (including none).

Square brackets [] can be used to contain a list of characters [123] , a range of characters [aj] , or a combined list and range [123aj] ; this pattern will match any one character from the list or range. Using an exclamation mark or carat symbol as the first character inside the square brackets will invert the meaning, causing a match with any one character which is not in the list or range.

Table 4-6 lists some examples of ambiguous filenames.

Table 4-6. Ambiguous filenames

Filename Description Matches Does not match
a* Any filename starting with a absolutely.txt Albert
a.out backup
albert _abc_
*x* Any filename containing an x xylophone.gif constantinople
nexus ALEX
old.x
*[09] Any filename ending in a digit file3 file
menu.backup60 file3a
file3.txt
416-555-1212.phone
[Aa]???.txt Any eight-character filename starting with a or A and ending in .txt appl.txt application.txt
ax42.txt a.txt
Any1.txt allow.txt
[azAZ][09] Any two-character filename starting with a letter and ending with a digit a9 No
G7 7G
N3 XX
Fortran77
[!azAZ]* Any filename that does not start with a letter 9lives.odt abc.txt
[^azAZ]* _whatever Nevermore


4.3.1.2. Key directories | Fedora Linux | 4.3.1.4. Choosing easy-to-use filenames