How to Find Any File on Linux Using the Terminal

Tutomod • Premium content made for you.

How to Find Any File on Linux Using the Terminal

You know the file exists. You saved it last month, in some folder, probably. The terminal finds it in seconds.

Updated August 08, 2026, after a fresh review, with updated visuals and links.

Two commands cover 99% of searches: find for precision, locate for speed. Learn both and the file manager's search box starts feeling like dial up.

Searching files from the Linux terminal
Photo by César Gaviria on Pexels

What you'll need

  • Any Linux system
  • A terminal

Here's how it works

  1. Find by name with find. find ~ -name 'report.pdf' searches your whole home folder for that exact name. Use quotes, and wildcards work: find ~ -name '*.pdf' lists every PDF you own.
  2. Ignore upper and lower case. Add -i: find ~ -iname 'budget*' catches Budget, BUDGET and budget. This option saves more searches than any other.
    • ~ means your home folder; use / to search the entire disk (add sudo if it complains)
    • Narrow by folder to search faster
  3. Search inside file contents with grep. grep -ri 'invoice' ~/Documents finds files CONTAINING the word invoice. i ignores case, r goes through folders. Perfect for 'I wrote it but where did I save it' moments.
  4. Find files modified recently. find ~ -mtime -7 lists everything changed in the last week. -mtime -1 is the last 24 hours. Great when you literally just saved the thing.
  5. Use locate for instant results. locate report.pdf searches a prebuilt database of every file, so it's immediate. Run sudo updatedb first if the file was created today and doesn't appear yet.
Using find and locate commands
Photo by TREEDEO.ST on Pexels

Small tweaks, big difference

  • Combine with size: find ~ -size +500M -type f hunts the giant files eating your disk.
  • Piping to less (find ~ -name '*.log' | less) keeps long lists scrollable.
  • On many distros fdfind (or fd) is a friendlier find: same idea, nicer defaults, brew it if you like it.

Common mistakes, and how to dodge them

  • Searching from / can crawl through huge system folders and take ages. Start from your home folder unless you're sure.
  • Forgetting quotes around names with spaces splits the search into pieces and confusing errors result.

Questions people ask

find or locate?
find is precise and current. locate is instant but can miss files created since the last database update.

Can I search by file type without knowing the extension?
Sort of: find ~ -type f -newer speaker notes + mimetype tools exist, but extension searching is the practical route.

Keep reading

Wrapping up

find for exact work, locate for instant answers, grep when the name escaped you. The 'lost file' problem basically ends today.