Search
Summary
This note is a quick reference for finding text and files in the shell. These commands are some of the most useful building blocks for troubleshooting and general terminal work.
Commands
| Command | Purpose |
|---|---|
grep error logfile.log | search for matching text inside a file |
| `journalctl | grep ssh` |
find . -name "*.txt" | search for files by name from the current directory downward |
Example usage
grep error app.log
journalctl | grep ssh
find . -name "*.conf"Notes
grepis for matching textfindis for locating files and directories- using both together becomes very common once you start troubleshooting logs and configuration
Related
- Back to Linux Reference
- [Viewing content](Viewing content)
- Navigation
- [System Info](System Info)