🔎 Grep && Sed

Advanced text searching and manipulation techniques

What does the following command do?

echo "Hi Mom" | grep -o "Mom" | sed 's/Mom/Universe/'

Searching for Text with Grep

Search through a single file:

file_type_config command line
grep "mom" file.txt

Search through a directory recursively:

file_type_config command line
grep -r "mom" .

Edit text with Sed

Run a find and replace operation with sed:

file_type_config command line
sed 's/mom/dad' file.txt

Bonus Video

Learn more regex to match advanced patterns.

Questions? Let's chat

Open Discord