[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mv files by date



Curtis Vaughan wrote:
Ok the following line finds all the files that I want to move out the folder:

find ./ -type f ! -mtime -2 -exec ls -al {} \;

So, now it's the next part that scares me.

Should I do this?

find ./ -type f ! -mtime -2 -exec ls -al {} \; | xargs mv ../

in order to move the files found in the script up one directory?

Curtis

why not just do:
find ./ -type f ! -mtime -2 -exec mv {}  ../dest/dir/  \;

unless you have too many files and need to use xargs, then you could do:
find ./ -type f  ! -mtime -2 | xargs -I {} -t mv $1/{} ../dest/dir/



Reply to: