Advertisement
v1ral_ITS

cp or mv all file.EXT types EASY [NOTES]

Jun 30th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.45 KB | None | 0 0
  1. ############################################################################
  2. # NOTES ON HOW TO COPY ALL INSTANCES OF CHOSEN FILE EXTENSION TYPE AND CP #
  3. ############################################################################
  4.  
  5. # EXAMPLE 1
  6. cp --parents `find -name \*.xls*` /target_directory/
  7. # EXAMPLE 2
  8. find dir_name '*.mp3' -exec cp -vuni '{}' "../dest_dir" ";"
  9. # EXAMPLE 3
  10. find SOURCEPATH -name filename*.txt -exec cp --parents {} DESTPATH \;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement