Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
find [2023/01/18 13:23] adminfind [2024/12/30 12:03] (current) – [All files modified today] admin
Line 12: Line 12:
 ===== All files modified today ===== ===== All files modified today =====
 <code> <code>
 +find / -path /proc -prune -o -path /sys -prune -o -type f -newermt "$(date +%Y-%m-%d)" -ls|more
 find / -mount -mtime -1 -ls |sort -k 11 |less find / -mount -mtime -1 -ls |sort -k 11 |less
 </code> </code>
 +
 +===== FILES NOT OWNED BY APACHE FORMATTED =====
 +<code>
 +# find data/ \! -user apache -printf "%u \t %g \t %t \t %s \t %h%p \n"
 +</code>
 +
 +===== MULITPLE FILENAMES =====
 +<code>
 +# find . \( -iname \*40785\* -o -iname \*40791\* -o -iname \*40806\* \) -exec ls -l {} \;
 +</code>
 +
 +===== SPECIFIC PERMS =====
 +<code>
 +# 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
 +</code>
 +
 +===== FIND AND CORRECT PERMS =====
 +<code>
 +# find apps/ -type d -exec chmod g+w {} \;
 +# find apps/ -type d -exec chmod g-s {} \;
 +</code>
 +
 +===== WITH EXCLUDED PATHS =====
 +<code>
 +# find . -path './data' -prune -o -path './logs' -prune -o -type f -exec grep -iHn "ecu.edu.au" {} \; |less
 +</code>
 +
 +===== WITH EXCLUDED FILES FORMATTED =====
 +<code>
 +# find cache/ ! \( -name "sess_*" \) -ctime 1 -printf "\t%s \t %a \t %h%p \n"
 +# find cache/ ! \( -name "sess_*" \) -mmin 700 -printf "%t \t %s \t %h%p \n" 2>/dev/null
 +</code>
 +
 +===== SIZE OF FOLDERS/FILES IN A SINGLE FOLDER =====
 +<code>
 +# find /var/log/ -maxdepth 1 -exec du -s {} \; |sort -n
 +</code>
 +
 +===== FILES CHANGED IN THE LAST 24 HOURS AND PRINT FORMATTED =====
 +<code>
 +# find . -type f -ctime 1 -printf "\t%s \t %a \t %h%p \n"
 +</code>
 +
 +===== FILES WITH GROUP STICKY BIT SET =====
 +<code>
 +# 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 {} \;
 +</code>
 +
 +===== FIX DIRECTORIES WITH STICKY BIT SET =====
 +<code>
 +# find . -type d -exec chmod g-s {} \;
 +</code>
 +
  • find.1674019420.txt.gz
  • Last modified: 2023/01/18 13:23
  • by admin