Find
From Wsms
Find all files, or just ones that are interesting. List them, or do something with them.
Find all files in /etc directory newer than ten minutes old:
# find /etc -mmin -10 -print
Find all files in /etc directory newer than one day old:
# find /etc -mtime -1 -print
Find all the .wmv files and get a long listing:
# find / -name "*.wmv" -exec ls -l '{}' \;
Find all the files in your home directory and save the list to another file:
# find ~ -name "*" -print > find.out
Find all the files that are symbolic links:
# find . -type l -print
Keep a hard disk like the Seagate_FreeAgent somewhat busy so it doesn't go to sleep or something:
# nice find /mnt/sda3/ -type f -exec cat '{}' > /dev/null \;
List empty directories:
$ find -type d -empty
Remove empty directories:
[ggeller@arthur George]$ find -depth -type d -empty -exec rmdir '{}' \;
Prettify the output by removing the initial ./:
ggeller@arthur:~$ find . -name "*.log" | perl -ne 's/^.\/// ; print'
[edit]
