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

index c4ee47f63bab4835dfd14035ea308ebd4d0e7044..aab5063431e83cbca68e06bdcee76bb1919fc9f2 100644 (file)
@@ -166,15 +166,19 @@ continues the loop as long as the value in the variable COUNTER is less than 10
 ## 6. Finding Things
 ### a) How to select lines matching patterns in text files...
 To find information within files, you use a command called `grep`. 
-| Example command | Description |
-|-----------------|-------------|
+| Example command                | Description                                                                                    |
+|--------------------------------|------------------------------------------------------------------------------------------------|
 | `grep [options] day haiku.txt` | finds every instance of the string `day` in the file haiku.txt and pipes it to standard output |                                                                                                                                                                                                                |  
-|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|  
+
+#### a.1) Commonly used `grep` options
+
+|      | `grep` options                                                                                                                                                                                                       |  
+|------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|  
 | `-E` | tells grep you will be using a regular expression. Enclose the regular expression in quotes. _Note:_ the power of `grep` comes from using regular expressions. Please see the regular expressions sheet for examples |  
-| `-i` | makes matching case-insensitive |  
-| `-n` | limits the number of lines that match to the first n matches |  
-| `-v` | shows lines that do not match the pattern (inverts the match) |  
-| `-w` | outputs instances where the pattern is a whole word |  
+| `-i` | makes matching case-insensitive                                                                                                                                                                                      |  
+| `-n` | limits the number of lines that match to the first n matches                                                                                                                                                         |   
+| `-v` | shows lines that do not match the pattern (inverts the match)                                                                                                                                                        |  
+| `-w` | outputs instances where the pattern is a whole word                                                                                                                                                                  |  
 
 ### b) How to find files with certain properties...
 To find file and directory names, you use a command called `find`