Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| find [2023/01/18 13:23] – admin | find [2024/12/30 12:03] (current) – [All files modified today] admin | ||
|---|---|---|---|
| Line 12: | Line 12: | ||
| ===== All files modified today ===== | ===== All files modified today ===== | ||
| < | < | ||
| + | find / -path /proc -prune -o -path /sys -prune -o -type f -newermt " | ||
| find / -mount -mtime -1 -ls |sort -k 11 |less | find / -mount -mtime -1 -ls |sort -k 11 |less | ||
| </ | </ | ||
| + | |||
| + | ===== FILES NOT OWNED BY APACHE FORMATTED ===== | ||
| + | < | ||
| + | # find data/ \! -user apache -printf "%u \t %g \t %t \t %s \t %h%p \n" | ||
| + | </ | ||
| + | |||
| + | ===== MULITPLE FILENAMES ===== | ||
| + | < | ||
| + | # find . \( -iname \*40785\* -o -iname \*40791\* -o -iname \*40806\* \) -exec ls -l {} \; | ||
| + | </ | ||
| + | |||
| + | ===== SPECIFIC PERMS ===== | ||
| + | < | ||
| + | # find . -type d -perm +g=x \! -perm +g=w \! -user apache -exec chmod g+w {} \; | ||
| + | # find . -group pr -type f \! -perm +u=w -exec chmod u+w {} \; | ||
| + | # find . \! -perm +a=r -exec ls -ld {} \; | ||
| + | # find apps/ -type d -exec ls -ld {} \; | less | ||
| + | </ | ||
| + | |||
| + | ===== FIND AND CORRECT PERMS ===== | ||
| + | < | ||
| + | # find apps/ -type d -exec chmod g+w {} \; | ||
| + | # find apps/ -type d -exec chmod g-s {} \; | ||
| + | </ | ||
| + | |||
| + | ===== WITH EXCLUDED PATHS ===== | ||
| + | < | ||
| + | # find . -path ' | ||
| + | </ | ||
| + | |||
| + | ===== WITH EXCLUDED FILES FORMATTED ===== | ||
| + | < | ||
| + | # find cache/ ! \( -name " | ||
| + | # find cache/ ! \( -name " | ||
| + | </ | ||
| + | |||
| + | ===== SIZE OF FOLDERS/ | ||
| + | < | ||
| + | # find /var/log/ -maxdepth 1 -exec du -s {} \; |sort -n | ||
| + | </ | ||
| + | |||
| + | ===== FILES CHANGED IN THE LAST 24 HOURS AND PRINT FORMATTED ===== | ||
| + | < | ||
| + | # find . -type f -ctime 1 -printf "\t%s \t %a \t %h%p \n" | ||
| + | </ | ||
| + | |||
| + | ===== FILES WITH GROUP STICKY BIT SET ===== | ||
| + | < | ||
| + | # find . -perm 2775 -printf "%m %g" -exec ls -d {} \; | ||
| + | # find . -maxdepth 2 -perm -2000 -type d -printf "%m \t %u \t %g \t" -exec ls -d {} \; | ||
| + | </ | ||
| + | |||
| + | ===== FIX DIRECTORIES WITH STICKY BIT SET ===== | ||
| + | < | ||
| + | # find . -type d -exec chmod g-s {} \; | ||
| + | </ | ||
| + | |||