Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

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
 
PREVIOUS NEXT
Tagged: #copy #specific #files #directories
ADD COMMENT
Topic
Name
3+4 =