Skip to content

Q&A · Answered

How to find files by name on Linux

asked 9 months, 3 weeks ago 1782 views 1 answer
47

I need to search for files by name. What commands can I use?

1 Answer

One accepted
24

Accepted answer

Not confirmed since it was written, 9 months, 3 weeks ago
# Using find
find / -name "filename.txt"

# Case insensitive
find / -iname "*.log"

# Find by type
find /var -type f -name "*.log"

# Using locate (faster but needs updatedb)
sudo updatedb
locate filename.txt

Your answer

Say what you tried, not only what worked — the next person needs the reasoning. Code goes in a fenced block.

Shown beside your answer and never checked, so it cannot be a name someone already has here.

No account needed to answer. Sign in instead and it carries your name and earns reputation.