Docs / Linux Basics / How to Use find to Locate Files

How to Use find to Locate Files

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 270 views · 1 min read

The find command searches for files and directories on your server.

Find by Name

find / -name "nginx.conf"
find /var -name "*.log"

Find by Type

# Files only
find /var -type f -name "*.conf"

# Directories only
find /home -type d -name "backup"

Find by Size

# Files larger than 100MB
find / -type f -size +100M

# Files smaller than 1KB
find / -type f -size -1k

Find by Modification Time

# Modified in last 24 hours
find /var/log -type f -mtime -1

# Modified more than 30 days ago
find /tmp -type f -mtime +30

Find and Delete

# Delete files older than 30 days
find /tmp -type f -mtime +30 -delete

Was this article helpful?