← Files & Text
Linux · Files & Text

How to find files in Linux

Find files by name, type, modification time, and size with find, and quickly by name with locate.


Search the filesystem for files that match criteria. find walks the tree in real time; locate is instant but reads a periodically updated database.

# By name (case-insensitive)
find /var -iname '*.log'

# By type, modified in the last 24 hours
find /home -type f -mtime -1

# Bigger than 100 MB, one filesystem only
find / -xdev -type f -size +100M

# Run a command on each match (-delete would remove them)
find /tmp -type f -name '*.tmp' -exec ls -l {} \;

# Instant name search (updatedb populates the database)
locate nginx.conf
LinuxfindFiles