Answers for "copy specific files only from directories"

0

copy specific files only from directories

rsync -a -m --include='*.jpg' --include='*/' --exclude='*' src_directory/ dst_directory/

--include='*.jpg' - First we are including all .jpg files.
--include='*/' - Then we are including all directories inside the in src_directory directory. Without this rsync will only copy *.jpg files in the top level directory.
-m - Removes the empty directories
Posted by: Guest on May-19-2021

Code answers related to "copy specific files only from directories"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language