Hello folk,
I want to move some *.jpg and *.JPG to some folder but i want move from current path not from subdirectories, wants to move 200 days old file.
it will go in /dir/aa/target/*.jpg|*.JPG but not go inside /dir/aa/target/other-directories,
Plese help
pludi
2
I'd say before you can move files you have to man find (POSIX) them first. Especially look at the -prune, -type, -name, -mtime, and -exec options.
below command seems fine.
find ./ -maxdepth 1 -type f -name "*.jpg" -mtime +200 -exec cp {} /backup/ \;