Ad space (banner)
🖥️Linux Lessons
Lesson 16 / 61

Finding Files with find

find is for when "I don't know where this file is." find searches an entire directory tree for files or folders matching a given condition.

Use it in the form find starting-location -name filename. Give . as the starting location, and it searches every folder from your current location downward.

Running find . -name notes.txt recursively searches every folder from your current location, and prints the path wherever a file named notes.txt is found.

A common early mistake is confusing this with grepfind searches by filename, while grep searches by the text content inside files; keep that difference in mind.

In real work, this is used for investigative tasks — finding a specific file inside a huge project, rounding up old log files, and more.

Linux
Try it (type this into the pseudo terminal)
find . -name notes.txt

🧑‍💻 You can type this command into the Linux pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)