Skip to content

Commit

Permalink
Improve ripgrep examples
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisguest75 committed Nov 6, 2023
1 parent c4c4f0d commit 0931bb0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 7 additions & 2 deletions 24_finding_files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ locate "/etc/*.conf"

## exa

exa is a modern replacement for the venerable file-listing command-line program ls that ships with Unix and Linux operating systems, giving it more features and better defaults.

```sh
brew install exa

Expand All @@ -88,6 +90,8 @@ exa -laTR --icons --git | grep ".*\.md"

## fd

fd is a program to find entries in your filesystem. It is a simple, fast and user-friendly alternative to find.

```sh
brew install fd

Expand All @@ -100,17 +104,18 @@ fd -e md

## ripgrep

ripgrep is a line-oriented search tool that recursively searches the current directory for a regex pattern.

```sh
brew install ripgrep

# find all files containing README
rg README
rg --ignore-case README

# searching in node_modules (including .gitignore)
rg --no-ignore --hidden "items to be sent"
```


## Resources

* ogham/exa repo [here](https://github.com/ogham/exa)
Expand Down
6 changes: 6 additions & 0 deletions 51_grep_and_regex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

Demonstrates examples of how to use grep and regex.

REF: ripgrep in [24_finding_files/README.md](../24_finding_files/README.md)

```sh
# MacOS grep (BSD grep, GNU compatible) 2.6.0-FreeBSD
grep --version
```

Expand All @@ -16,6 +19,9 @@ brew install grep

# can now use ggrep
ggrep

# ggrep (GNU grep) 3.7
ggrep --version
```

## Common uses
Expand Down

0 comments on commit 0931bb0

Please sign in to comment.