🔎 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:
command line
grep "mom" file.txt
Search through a directory recursively:
command line
grep -r "mom" .
Edit text with Sed
Run a find and replace operation with sed:
command line
sed 's/mom/dad' file.txt
Bonus Video
Learn more regex to match advanced patterns.