Skip to content

Commit 8824df7

Browse files
committed
Patterns: grep and find options corrections
1 parent 8bbcf7c commit 8824df7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎docs/patterns.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Some commonly used options are:
4040

4141
- **-i**: ignore case
4242
- **-o**: only output the instance of the pattern you search for, not the full line
43-
- **-e**: use a regular expression as pattern for what you search for
43+
- **-e**: use a regular expression as pattern, can be used multiple times (OR operation), protects patterns starting with "-"
4444
- **-c**: do not output the line, just print a count of matching lines
4545
- **-n**: Prefix each line of output with the 1-based line number within its input file.
4646
- **-r**: Read all files under each directory, recursively. If no file operand is given, grep searches the working directory.
@@ -102,15 +102,15 @@ find [path] [options] [expression]
102102
```
103103

104104
- **path** is the starting directory for the search
105-
- **options** are settings or conditions for the search
106-
- **expression** is the criteria for filtering and locating files (for instance, only search ``txt```files or only files named ``docs``).
105+
- **options** are settings or conditions that modify how the search is performed
106+
- **expression** is the criteria for filtering and locating files (for instance, only search for ``txt`` files or only files named ``docs``).
107107

108108
**Useful common options**
109109

110110
- **-type f**: only search for files
111111
- **-type d**: only search for directories
112112
- **-name NAME**: only search for files with a specific name NAME or pattern
113-
- **-size [+/-]n**: Searches for files based on size. `+n` finds larger files, `-n` finds smaller files. ‘n‘ measures size in characters.
113+
- **-size [+/-]n**: Searches for files based on size. `+n` finds larger files, `-n` finds smaller files. `n` measures size in units of space.
114114
- **-mtime n**: Finds files based on modification time. `n` represents the number of days ago.
115115
- **-exec command {} \;**: Executes a command on each file found.
116116

0 commit comments

Comments
 (0)