How to find files that were last modified 10 days ago, use:
root# find / -iname "*" -mtime -10 -print
How to find files that were last modified 10 days ago and for each of them do stat:
root# find / -iname "*" -mtime -10 -exec stat {} ;
How to find files that were last modified 24 hours ago and move them to some directory:
root# find / -name "*.png" -mmin -1440 -exec mv {} some_directory ;
How to find all files in your home directory modified or created today. By default, find counts days from midnight, so an age of zero means today.
user~> find ~ -type f -mtime 0
Find all file belongs to group “ftpusers” in /home directory, enter:
root# find /home -group ftpusers
Find all file belongs to user root in / directory
root# find / -user root
Find files and directories that are not owned by user, use:
find ~ ! -user ${USER}
Find anything in the current user’s directory that is not owned by that user and fix the permissions:
find ~ ! -user $USER -exec sudo chown ${USER}:"{}" ;
Find file and redirect errors to /dev/null
find / -name "apache2" -print 2>/dev/null
—
Other options:
access (read the file’s contents) – atime
change the status (modify the file or its attributes) – ctime
modify (change the file’s contents) – mtime