Filter Command Output with grep
What This Does
Show only lines from command output that contain a specific word or pattern, hiding everything else.
Why It's Useful
Find what matters, ignore the rest. When command output is long, grep shows only the lines you care about.
How to Do It
- Pipe command output to
grepfollowed by your search term - For example:
ls -la | grep Documentsshows only files with "Documents" in the name - Or:
ps aux | grep pythonshows only processes containing "python"
Try This Now
Run ls ~ | grep Doc to see only files and folders in your home directory that contain "Doc" in their names.
Mental Hook: Find what matters, ignore the rest.