find

# find files without read / write permissions for other
find /media/foo /media/bar ! -perm -o+rw -exec ls -l {} \;
find /media/foo /media/bar -ctime -1 -type f ! -perm -go+rw -exec chmod a+rw {} \;
find /media/foo /media/bar -1 -type d ! -perm -go+rwx -exec chmod 777 {} \;
 
# changed in last 1 minute
find /tmp -cmin -1
 
# find all empty files
find  /tmp -type f -empty
 
# find empty directories
find . -type d -empty
 
# print file content
find ./ -type f | while 
  read f; do printf "\n# file %s\n" "$f"; cat "$f";
done
 
# find files by date
find /path/to/dir -newermt "yyyy-mm-dd"
 
# list all files modified on given date
find /path/to/dir -newermt yyyy-mm-dd ! -newermt yyyy-mm-dd -ls
 
# create directory in all subdirectories
find -mindepth 1 -maxdepth 1 -type d -exec mkdir {}/en_US \;
 
# count files in a directory
find /path/to/dir -type f | wc -l
 
# find files from a user
find / -user foo
find /home -maxdepth 1 -type d -group FOO -printf "%f\n"
 
# find files with SUID bit
find / -perm 4000
find / -perm /u+s
find / -perm -u+s
 
# find print filename only
find /tmp -printf "%f\n"
 
# find big files
find /var -type f -size +1G -exec du -sh {} \;
 
# find file with size between
find . -type f -size +8M -size -10M -ls
 
find . -type d -size +4096c
 
# Remove files older then 1 day from /tmp
find /tmp/ -mtime +1 -exec rm -r {} \;
 
# remove files older then 23h
find /backup -name "$(hostname).${DB}.*.dmp" -mmin +$((23*60)) -delete
 
# files created in last 5 min
find -cmin -5
 
# find files modified in last 1 hour
find /path/to/dir -mmin -60 -type f
 
# replace owner
find -type f -uid 3000000 -exec chown 1000000:1000000 {} \;
 
# find NOT
find -name "*.json" -not -name '00000*'
 
# remove softlinks from /media
find /media -maxdepth 1 -type l
 
# find log errors
find /var/log/ -name "*.log" -ctime -1 | xargs tail -f {} \; | egrep -i "fail|error"
 
# show all changes under log directory
find /var/log/ -ctime -1 | xargs tail -f {} \;