find /opt/test/ -mtime +2 -type f -exec ls -l {} \;
find /opt/test/ -mtime +2 -type f -exec rm -f {} \;
find (Destination) -mtime(How many Days Old) -type f(This restricts to regular files) -exec (to run command) rm -f (command to delete files)
Deleting files with .log extension
find . -name '*log*' -mtime +5 -exec rm -f {} \;
find . -mtime -1 -type f -exec cp -r {} /tmp/files_to_move \; copying multiple contents.
No comments:
Post a Comment