general_find
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
general_find [2022/09/24 01:35] – [Find Stuff in Linux] gman | general_find [2024/01/19 00:06] (current) – gman | ||
---|---|---|---|
Line 7: | Line 7: | ||
- find | - find | ||
- | ====== whereis | + | ===== whereis ===== |
Searches for binary files, source files, and man pages for the specified command names. Switches: | Searches for binary files, source files, and man pages for the specified command names. Switches: | ||
Line 25: | Line 25: | ||
---- | ---- | ||
- | ====== which ====== | + | ===== which ===== |
Returns the path to the executable indicated. | Returns the path to the executable indicated. | ||
Line 35: | Line 35: | ||
---- | ---- | ||
- | ====== locate | + | ===== locate ===== |
Fast way to search for files by name on your disk. | Fast way to search for files by name on your disk. | ||
Line 49: | Line 49: | ||
---- | ---- | ||
- | ====== find ====== | + | ===== find ===== |
- | ===== Basic Syntax | + | ==== Basic Syntax ==== |
< | < | ||
Line 84: | Line 84: | ||
---- | ---- | ||
- | ===== Search Location Shortcuts | + | ==== Search Location Shortcuts ==== |
The first argument after the find command is the location you wish to search (the starting point, and find will recurse into subdirs). | The first argument after the find command is the location you wish to search (the starting point, and find will recurse into subdirs). | ||
Line 97: | Line 97: | ||
---- | ---- | ||
- | ===== Expressions | + | ==== Expressions ==== |
This specifies how we want to match what we are looking for. | This specifies how we want to match what we are looking for. | ||
Line 114: | Line 114: | ||
---- | ---- | ||
- | ===== Find Files by Type ===== | + | ==== Find Files by Type ==== |
Use the '' | Use the '' | ||
^ Type ^ Description | ^ Type ^ Description | ||
- | | | + | | |
- | | c | character (buffered) special | + | |
| d | directory | | | d | directory | | ||
+ | | l | symbolic link | | ||
+ | | c | character device | | ||
+ | | b | block device | | ||
| p | named pipe (FIFO) | | | p | named pipe (FIFO) | | ||
- | | f | regular file | | ||
| s | socket | | | s | socket | | ||
Line 136: | Line 137: | ||
---- | ---- | ||
- | ===== Find Files by Size ===== | + | ==== Find Files by Size ==== |
Use the '' | Use the '' | ||
Line 162: | Line 163: | ||
---- | ---- | ||
- | ===== Find Files by Owner ===== | + | ==== Find Files by Owner ==== |
Use the '' | Use the '' | ||
Line 170: | Line 171: | ||
---- | ---- | ||
- | ===== Find Files by Perms ===== | + | ==== Find Files by Perms ==== |
Use the '' | Use the '' | ||
Line 194: | Line 195: | ||
find . -type f -perm -220 | find . -type f -perm -220 | ||
# find files writeable by BOTH owner AND group (but no one else) | # find files writeable by BOTH owner AND group (but no one else) | ||
+ | |||
+ | find / -perm /4000 -type f -exec ls -ld {} \; 2>/ | ||
+ | # This will find files with the SUID bit set. | ||
+ | # -l long listing format | ||
+ | # -d list directory names, not contents | ||
</ | </ | ||
---- | ---- | ||
- | ===== Find Files by Timestamps | + | ==== Find Files by Timestamps ==== |
You can find files by modification, | You can find files by modification, |
general_find.1663983313.txt.gz · Last modified: by gman