Monday 9 April 2012

Find all files recursively in the current directory and process them one by one

Finding all files in the current directory, and execute a command on each file:


find ./ -mtime +1 -exec rm -vf {} \;


the command executed on each file is in italics in the above line, and '{}' is replaced by the file name during the command execution.

No comments:

Post a Comment