find Flashcards
find
GNU find searches the directory tree rooted at each given starting-point by evaluating the given expression from left to right, according to the rules of precedence until the outcome is known, at which point find moves on to the next file name.
![](https://s3.amazonaws.com/brainscape-prod/system/cm/313/329/894/a_image_thumb.png?1591378771)
find [OPTIONS]
- P
- L
- H
- D
- 0
- P, Never follow symbolic links.
- L, Follow symbolic links.
- H, Do not follow symbolic links, except while processing the command line arguments.
- D debugopts, Print diagnostic information.
- 0level, Enables query optimisation.
find . -name text1
Finds files with the name text 1 in the current directory.
find /home -name text1
Finds files with the name text1 in the /home directory.
find /home -iname text1
Ignores the case of text1 while trying to find matching files in /home.
find / -type d -name text1
Searches for directories from / named text1
find . -type f -name text.php
Looks for files named text.php in current directory.
find . -type f -name “*.php”
Finds all php files in current directory.
find / -type f -perm 0777 -print
Find all the files whose permissions are 777.
find / -type f ! -perm 777
Find all the files without permission 777.
find / -perm 2644
Find all the SGID bit files whose permissions set to 644.
find / -perm 1551
Find all the Sticky Bit set files whose permission are 551.
find / -perm /u=s
Find all SUID set files.
find / -perm /g=s
Find all SGID set files.
find / -perm /u=r
Find all Read Only files.