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.
1. Find a file by name in the current directory
# find . -name rumenz.txt
./rumenz.txt2. Find a file by name in the home directory
# find /home -name rumenz.txt
/home/rumenz.txt3. Find a file by name (case‑insensitive)
# find /home -iname rumenz.txt
./rumenz.txt
./rumenz.txt4. Find a directory by name
# find / -type d -name rumenz
/rumenz5. Find a PHP file by exact name
# find . -type f -name rumenz.php
./rumenz.php6. Find all PHP files in a directory
# find . -type f -name "*.php"
./rumenz.php
./login.php
./index.php7. Find files with 777 permissions
# find . -type f -perm 0777 -print8. Find files that do NOT have 777 permissions
# find / -type f ! -perm 7779. Find files with SGID bit set to 644 (example command)
# find / -perm 264410. Find files with sticky bit set to 551
# find / -perm 55111. Find SUID files
# find / -perm /u=s12. Find SGID files
# find / -perm /g=s13. Find read‑only files
# find / -perm /u=r14. Find executable files
# find / -perm /a=x15. 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 -empty20. Find all empty directories
# find /tmp -type d -empty21. Find all hidden files
# find /tmp -type f -name ".*"22. Find a single file owned by a specific user
# find / -user root -name rumenz.txt23. Find all files owned by a specific user
# find /home -user rumenz24. Find all files belonging to a specific group
# find /home -group developer25. 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 5027. Find files accessed in the last 50 days
# find / -atime 5028. Find files modified between 50 and 100 days ago
# find / -mtime +50 -mtime -10029. Find files changed in the last hour
# find / -cmin -6030. Find files modified in the last hour
# find / -mmin -6031. Find files accessed in the last hour
# find / -amin -6032. Find files of exactly 50 MB
# find / -size 50M33. Find files between 50 MB and 100 MB
# find / -size +50M -size -100M34. 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 {} \;Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
