aboutsummaryrefslogtreecommitdiff
path: root/content/notes/grep-to-less-maintain-colors.md
diff options
context:
space:
mode:
Diffstat (limited to 'content/notes/grep-to-less-maintain-colors.md')
-rw-r--r--content/notes/grep-to-less-maintain-colors.md11
1 files changed, 5 insertions, 6 deletions
diff --git a/content/notes/grep-to-less-maintain-colors.md b/content/notes/grep-to-less-maintain-colors.md
index 9b797ee..6df2761 100644
--- a/content/notes/grep-to-less-maintain-colors.md
+++ b/content/notes/grep-to-less-maintain-colors.md
@@ -7,16 +7,15 @@ draft: false
7tags: [bash] 7tags: [bash]
8--- 8---
9 9
10I often use `grep` to search for todo's in my code and other people's 10I often use `grep` to search for todo's in my code and other people's code and
11code and then pipe them in `less` and I missed having colors that grep 11then pipe them in `less` and I missed having colors that grep outputs in `less`.
12outputs in `less`.
13 12
14- Grep's `--color=always` use markers to highlight the matching strings. 13- Grep's `--color=always` use markers to highlight the matching strings.
15- Less's `-R` option outputs "raw" control characters. 14- Less's `-R` option outputs "raw" control characters.
16 15
17You could use `alias grep='grep --color=always'` and `alias less='less 16You could use `alias grep='grep --color=always'` and `alias less='less -R'` or
18-R'` or create todo function in your `.bashrc` that accepts first argument 17create todo function in your `.bashrc` that accepts first argument as search
19as search string. 18string.
20 19
21```sh 20```sh
22# This is where the magic happens. 21# This is where the magic happens.