Answers for "copy multiple sources using cp command"

0

copy multiple sources using cp command

# You can use the following to copy multiple files from the same dir
# into another dir
# No space between after the comma

cp /path/to/source/dir/{file1,file2,file3} /path/to/dest/dir

# Another way that allows one to copy different sources from different locations
# into a dir is to use the "-t" option
# Note that the destination folder must come first

cp -t /path/to/dest file1 file2 file3
Posted by: Guest on May-11-2021

Browse Popular Code Answers by Language