aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cli
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2025-02-20 21:25:18 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2025-02-20 21:25:18 +0100
commit94a774fab936fef4b3218973c35543c19dae11d8 (patch)
tree2e2fd6811fac4bd7abdfab2b630fbb6b03705181 /src/cli
parentf6e78d5746b77bb48cdfee50b73da0dc26e3bcb9 (diff)
downloadnotes-94a774fab936fef4b3218973c35543c19dae11d8.tar.gz
notes-94a774fab936fef4b3218973c35543c19dae11d8.zip
grep: initial notes
Diffstat (limited to 'src/cli')
-rw-r--r--src/cli/README.md3
-rw-r--r--src/cli/grep.md20
2 files changed, 22 insertions, 1 deletions
diff --git a/src/cli/README.md b/src/cli/README.md
index 8144745..6b7a661 100644
--- a/src/cli/README.md
+++ b/src/cli/README.md
@@ -9,4 +9,5 @@
- [tac](./tac.md)
- [rev](./rev.md)
- [paste](./paste.md)
-- [xargs](./xargs.md) \ No newline at end of file
+- [xargs](./xargs.md)
+- [grep](./grep.md)
diff --git a/src/cli/grep.md b/src/cli/grep.md
new file mode 100644
index 0000000..a2001b9
--- /dev/null
+++ b/src/cli/grep.md
@@ -0,0 +1,20 @@
+# grep(1)
+
+```
+sort [opts] [pattern] [files]
+ -e <pattern> pattern to search for (can be supplied multiple times)
+ -i ignore case in patterns
+ -v invert match
+
+ -n add line numbers to matched lines
+ -H add file name to matched lines
+
+ -r recursively read all files
+ -I skip binary files
+ --include <glob> search only files matching glob
+ --exclude <glob> skip searching files matching glob
+
+ -c count occurrence of matched patterns
+ -l list only file name which contain the pattern
+```
+> `<glob>` patterns may need to be quoted or escaped if the shell also does glob expansion.