findutils

Examples

find /var -user www-data

... finds all files in /var belonging to user www-data



find /usr/ -group staff

... finds all files under /usr belonging to group staff



find /var/log -type f -size +500k

... finds all regular files larger than 500K (units of 1024 bytes)



find . -newermt $(date +%Y-%m-%d -d '1 day ago') -type f -print

... finds all files that are newer than '1 day ago'



find /my/path/ -type d -empty | gawk '{print "rm -d " $1}' | bash

... finds and removes all empty directories in /my/path



find / -gid OLDGID ! -type l -exec chgrp NEWGID {} \;

... changes GID for all files under / from OLDGID to NEWGID



find /my/path -type d -print0 | xargs -0 chmod 755

... sets chmod 755 to all files with type d (directories)

2026-04-11 10:49:54

minicms - © 2020-2026 Simeon Simeonov