Update shell_cheatsheet.md
authorLynne Williams <williams.lynne99@gmail.com>
Sun, 17 Feb 2013 15:14:51 +0000 (10:14 -0500)
committerW. Trevor King <wking@tremily.us>
Wed, 23 Oct 2013 22:27:28 +0000 (15:27 -0700)
shell_cheatsheet.md

index 173658f2b9b1ce95c04e41dd9c406e6f4c677812..8848ef66e6598b31e0f8506d244ba64ccafc9870 100644 (file)
 
 ## 3. Pipes and Filters
 ### a) How to use wildcards to match filenames...
+Wildcards are a shell feature that makes the command line much more powerful than any GUI file managers. You see, if you want to select a big group of files in a graphical file manager, you usually have to select them with your mouse. This may seem simple, but in some cases it can be very frustrating. For example, suppose you have a directory with a huge amount of all kinds of files and subdirectories, and you decide to move all the HTML files, that have the word "linux" somewhere in the middle of their names, from that big directory into another directory. What's a simple way to do this? If the directory contains a huge amount of differently named HTML files, your task is everything but simple!
+
+
+| Wildcard | Matches |
+----------------------
+| * | zero or more characters |
+| ? | exactly one character |
+| [abcde] | exactly one of the characters listed |
+| [a-e] | exactly one character in the given range |
+| [!abcde] | any character not listed |
+| [!a-e] | any character that is not in the given range |
+| {software,carpentry} | exactly one entire word from the options given |
+
+
+
 ### b) That wildcards are expanded by the shell before commands are run...
 ### c) How to redirect a command's output to a file...
 ### d) How to redirect a command's input from a file...