Find Files and Search Inside Them on Linux (find and grep)
Tools You'll Need
findgrep
Find files by name:
find ~ -iname "*invoice*": anything with "invoice" in the name, in your Home folder
find ~ -name "*.pdf": all PDFs
find ~ -size +500M: files bigger than 500 MB
find ~ -mtime -2: changed in the last 2 days
Search inside files:
grep "password" settings.txt: lines containing the word
grep -i "error" log.txt: ignore upper and lower case
grep -r "Kampala" ~/Documents: search all files in a folder
grep -n "word" file: show line numbers
Searching the whole system? Add 2>/dev/null at the end to hide "Permission denied" messages.