Update shell_cheatsheet.md
[swc-modular-shell.git] / shell_cheatsheet.md
index aab5063431e83cbca68e06bdcee76bb1919fc9f2..456c7d9ae5c5c4e3e710e2b810a2a49887d1be87 100644 (file)
@@ -165,7 +165,8 @@ 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`. 
+To find information within files, you use a command called `grep`.
+
 | 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 |                                                                                                                                                                                                                |  
@@ -183,10 +184,17 @@ To find information within files, you use a command called `grep`.
 ### b) How to find files with certain properties...
 To find file and directory names, you use a command called `find`
 
+| Example command  | Description |  
+|------------------|-------------|
+| `find . -type d` | `find` recursively descends the directory tree for each path listed to match the expression given in the command line with file or directory names in the search path |  
+
+
+#### b.1) Commonly used `find` options
 
-* **`find . -type d` -->
-       * **`-type [df]`** --> d lists directories; f lists files
-       * **`-maxdepth n`** --> `find` automatically searches subdirectories. If you don't want that, specify the number of levels below the working directory you would like to search
-       * **`-mindepth n`** --> starts `find`'s search n levels below the working directory
+|               | `find` options                                                                                                                                          |  
+|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|  
+| `-type [df]`  | `d` lists directories; `f` lists files                                                                                                                  |  
+| `-maxdepth n` | `find` automatically searches subdirectories. If you don't want that, specify the number of levels below the working directory you would like to search |
+| `-mindepth n` | starts `find`'s search `n` levels below the working directory                                                                                           |