Operations 5 min read

Master Linux ‘find’: Powerful File Search Techniques & Real‑World Examples

This guide explains how to use the Linux find command to locate files by name, size, time, permissions, owner or group, provides a full list of options, and includes practical examples demonstrating common search patterns and actions.

Open Source Linux
Open Source Linux
Open Source Linux
Master Linux ‘find’: Powerful File Search Techniques & Real‑World Examples

find: Search and locate files

Function description:

Using the find command you can list files that meet specified criteria such as name, type, time, size, permissions, etc. Only files that fully match are displayed.

Note: find's fuzzy search can be resource‑intensive; avoid running it during peak load.

Command syntax:

find [path] [options]

Option meanings:

The options are described below: -name <filename>: search by name -iname <filename>: case‑insensitive name search -user <username>: search by file owner -group <groupname>: search by group -size n[ckMG]: search by size (c=bytes, k=KB, M=MB, G=GB) -type <filetype>: search by file type -nouser: files without an owner -nogroup: files without a group -atime n: accessed within the last n days -amin n: accessed within the last n minutes -ctime n: metadata changed within the last n days -cmin n: metadata changed within the last n minutes -mtime n: content modified within the last n days -mmin n: content modified within the last n minutes

Parameter examples:

Example 1 – Search by name

# find /test -name abc
/test/abc
# find /test -iname abc
/test/abc
/test/ABC

Example 2 – Search by size

# find /date -size +10M
# find /date -size -1G
# find /date -size 98k

Example 3 – Search by time

# find / -mtime -1 -type f
# find / -mtime +1 -type f
# find / -atime +1 -type f
# find / -atime -1 -type f
# find / -ctime -1 -type f
# find / -cmin +60 -type f

Example 4 – Search by permissions

# find /test -perm 777

Example 5 – Search by owner/group

# find / -user esight -type f
# find / -nouser -type f
# find / -group esight -type f
# find / -nogroup -type f

Example 6 – Execute actions

# find /test -name "te.txt" -ok rm {} \;
# find /test -name "te.txt" -exec cp {} {}.bak \;
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

linuxSystem AdministrationShell scriptingFile Searchfind command
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.