Operations 8 min read

Master Linux File Search: 35 Essential find Command Examples

This guide presents 35 practical Linux find command examples covering file and directory name searches, case‑insensitive matching, permission‑based queries, size and time filters, as well as combined find‑and‑delete operations, helping users efficiently locate and manage files on Unix‑like systems.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Master Linux File Search: 35 Essential find Command Examples

1. Find a file by name in the current directory

# find . -name rumenz.txt

./rumenz.txt

2. Find a file by name in the home directory

# find /home -name rumenz.txt

/home/rumenz.txt

3. Find a file by name (case‑insensitive)

# find /home -iname rumenz.txt

./rumenz.txt
./rumenz.txt

4. Find a directory by name

# find / -type d -name rumenz

/rumenz

5. Find a PHP file by exact name

# find . -type f -name rumenz.php

./rumenz.php

6. Find all PHP files in a directory

# find . -type f -name "*.php"

./rumenz.php
./login.php
./index.php

7. Find files with 777 permissions

# find . -type f -perm 0777 -print

8. Find files that do NOT have 777 permissions

# find / -type f ! -perm 777

9. Find files with SGID bit set to 644 (example command)

# find / -perm 2644

10. Find files with sticky bit set to 551

# find / -perm 551

11. Find SUID files

# find / -perm /u=s

12. Find SGID files

# find / -perm /g=s

13. Find read‑only files

# find / -perm /u=r

14. Find executable files

# find / -perm /a=x

15. Find files with 777 permissions and change them to 644

# find / -type f -perm 0777 -print -exec chmod 644 {} \;

16. Find directories with 777 permissions and change them to 755

# find / -type d -perm 777 -print -exec chmod 755 {} \;

17. Find and delete a single file

# find . -type f -name "rumenz.txt" -exec rm -f {} \;

18. Find and delete multiple files (e.g., *.txt or *.mp3)

# find . -type f -name "*.txt" -exec rm -f {} \;

# find . -type f -name "*.mp3" -exec rm -f {} \;

19. Find all empty files

# find /tmp -type f -empty

20. Find all empty directories

# find /tmp -type d -empty

21. Find all hidden files

# find /tmp -type f -name ".*"

22. Find a single file owned by a specific user

# find / -user root -name rumenz.txt

23. Find all files owned by a specific user

# find /home -user rumenz

24. Find all files belonging to a specific group

# find /home -group developer

25. Find a user’s specific file type (case‑insensitive)

# find /home -user rumenz -iname "*.txt"

26. Find files modified in the last 50 days

# find / -mtime 50

27. Find files accessed in the last 50 days

# find / -atime 50

28. Find files modified between 50 and 100 days ago

# find / -mtime +50 -mtime -100

29. Find files changed in the last hour

# find / -cmin -60

30. Find files modified in the last hour

# find / -mmin -60

31. Find files accessed in the last hour

# find / -amin -60

32. Find files of exactly 50 MB

# find / -size 50M

33. Find files between 50 MB and 100 MB

# find / -size +50M -size -100M

34. Find and delete files larger than 100 MB

# find / -type f -size +100M -exec rm -f {} \;

35. Find specific large files (e.g., *.mp3 >10 MB) and delete them

# find / -type f -name *.mp3 -size +10M -exec rm {} \;
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.

LinuxFile Searchfind
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

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.