Skip to main content
IBM 
ShopSupportDownloads
IBM HomeProductsConsultingIndustriesNewsAbout IBM
IBM : developerWorks : Linux : Education - Tutorials
LPI certification 101 exam prep, Part 1
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPreviousNext
5. Introducing wildcards
  


Wildcard caveats, continued page 10 of 11


Using this approach, your new file will contain a literal [fo]* as expected. Alternatively, you could use backslash escaping to tell bash that [, ] and * should be treated literally rather than as wildcards:


$ echo \[fo\]\* > /tmp/mynewfile.txt

Both approaches will work identically. Since we're talking about backslash expansion, now would be a good time to mention that in order to specify a literal \, you can either enclose it in single quotes as well, or type \\ instead (it will be expanded to \).


Main menuSection menuFeedbackPreviousNext
PrivacyLegalContact