35 Essential Linux Find Command Examples Every Sysadmin Should Know
Discover 35 practical Linux find command examples covering name, permission, owner/group, date, and size based searches, complete with step‑by‑step illustrations, enabling you to locate, filter, and manage files and directories efficiently in everyday system administration tasks.
The Linux find command is a powerful tool for locating files and directories based on various criteria such as name, permissions, owner, group, timestamps, and size. This guide presents 35 common examples, organized into five sections, to help you master file searching in daily system administration.
First Part – Name Based File Search
1. Find files named test.c in the current directory
Searches for all files named test.c within the current working directory.
2. Find files named test under the home directory
Finds all files named test in the /home directory.
3. Find files named test ignoring case
Locates files named test regardless of case in /home.
4. Find directories named test
Searches for directories named test under the root ( /) path.
5. Find PHP files named test.PHP
Finds all PHP files named test.PHP in the current directory.
6. Find all PHP files in a directory
Lists every .php file inside the specified directory.
Second Part – Permission Based File Search
7. Find files with permission 777
Locates all files whose mode is 777.
8. Find files without permission 777
Finds files that do not have the 777 mode.
9. Find SGID files with mode 644
Searches for files that have SGID set and permission 644.
10. Find Sticky Bit files with mode 551
Finds files where the sticky bit is set and mode is 551.
11. Find SUID files
Lists all files with the SUID bit set.
12. Find SGID files
Lists all files with the SGID bit set.
13. Find read‑only files
Finds every file that is marked as read‑only.
14. Find executable files
Lists all files that have execute permission.
15. Find files with permission 777 and change to 644
Finds files with mode 777 and applies chmod 644 to them.
16. Find directories with permission 777 and change to 755
Finds directories set to 777 and changes their mode to 755.
17. Find and delete a single file
Locates a file named test.c and removes it.
18. Find and delete multiple files
Searches for several files (e.g., .mp3 or .txt) and deletes them.
19. Find all empty files
Finds every zero‑byte file in a given path.
20. Find all empty directories
Identifies directories that contain no files.
21. Find hidden files
Lists files whose names start with a dot ( .).
Third Part – Owner and Group Based Search
22. Find a file owned by root
Searches for test.c owned by user root in /root.
23. Find all files belonging to user neil
Lists every file in the home directory owned by user neil.
24. Find all files belonging to group Developer
Finds files in /home that belong to the group Developer.
25. Find .txt files of user neil
Searches for all .txt files in neil's home directory.
Fourth Part – Date and Time Based Search
26. Find files modified in the last 50 days
Lists files whose modification time is within the past 50 days.
27. Find files accessed in the last 50 days
Finds files accessed within the previous 50 days.
28. Find files modified between 50 and 100 days ago
Locates files whose modification time is older than 50 days but newer than 100 days.
29. Find files changed in the last hour
Searches for files whose content changed within the past hour.
30. Find files modified in the last hour
Finds files whose modification timestamp is within the previous hour.
31. Find files accessed in the last hour
Lists files that were accessed during the last hour.
Fifth Part – Size Based Search
32. Find files of exactly 50 MB
Locates all files whose size is precisely 50 MB.
33. Find files between 50 MB and 100 MB
Finds files larger than 50 MB but smaller than 100 MB.
34. Find and delete files of 100 MB
Searches for all 100 MB files and removes them with a single command.
35. Find specific files and delete them
Finds all .mp3 files larger than 10 MB and deletes them in one step.
These 35 commands cover most common uses of the find utility, providing a solid foundation for file searching and management in Linux environments.
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.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
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.
