find
find linux command cheatsheet by Thamizhiniyan C S
Introduction
The find command is used to search for files in a directory hierarchy.
Syntax
find [-H] [-L] [-P] [-D debugopts] [-Olevel] [starting-point...] [expression]
Important Flags
Flag | Description |
---|---|
| Follow symbolic links on command line only. |
| Follow all symbolic links. |
| Never follow symbolic links. |
| Process debugging option. |
| Matches files/directories by name. |
| Matches files by type. |
| Matches files by permission. |
| Matches files by owner. |
| Matches files by modification time. |
| Matches files by access time. |
| Matches files by changed minutes ago. |
| Matches files by accessed minutes ago. |
| Matches files by size. |
| Matches files that are writable. |
Examples
Command | Description |
---|---|
Read the manual for the find command | |
find the file named “flag1.txt” in the current directory | |
find the file names “flag1.txt” in the /home directory | |
find the directory named config under “/” | |
find files with the 777 permissions (files readable, writable, and executable by all users) | |
find executable files | |
find all files for user “frank” under “/home” | |
find files that were modified in the last 10 days | |
find files that were accessed in the last 10 day | |
find files changed within the last hour (60 minutes) | |
find files accesses within the last hour (60 minutes) | |
find files with a 50 MB size | |
find files that are larger than 100 MB | |
redirect errors to “/dev/null” and have a cleaner output | |
Find world-writeable folders | |
Find world-writeable folders | |
Find world-writeable folders | |
Find world-executable folders | |
Find files/directories named "gcc*" | |
Find files with setuid, suppress errors | |
Find setuid files, suppress errors | |
Find files with the SUID bit | |
Find files with the SUID bit | |
Find files based on date accessed | |
Find files based on date modified | |
Find files modified after a specific date | |
Find files based on group name | |
To perform the search and locate the links that do not work (Find Broken Symbolic Links) |
Last updated