Skip to content

find

Delete directories by pattern

find /path/to/dir -type d -name *.svn | xargs rm -rf

Delete files by pattern and older than 60 days

find /records -type f -name *.mp3 -mtime +60 -delete

Big files

find /path -mount -size +100M

Biggest files

find /path -mount -type f -ls 2>/dev/null | sort -rnk7 | head -30

Directories with mode 777

find /var/www/ -maxdepth 3 -type d -perm 0777

Looking pattern in gz archives

find /var/log/nginx/ -name domain.access.*.gz  -exec zgrep booter {} \;

Different user owner

find /var/www -not -user www-data

Rename email files in maildir format for sync from ext4 to extFAT,FAT32 and replacing restricted characters

find . -type f -name *:* -exec bash -c 'mv "$1" "$(echo $1 | sed -e 's/[,:=]/_/g')"' - {}  \;