Linux Commands/Find

From Wsms

Jump to: navigation, search

parent:

Find all file, or just one 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 \;
Personal tools