
Copy Bulk Files in Linux - Gabriel9999
I have multiple files in a Linux systems where I want to copy them with a single cp command into a different path and directory. Should I write a bash script to copy one by one?
======
edizgeorgi
No. You shouldn’t write a bash script. Just use the cp command bulk copy
feature and provide all files you want to copy and add the path which is the
destination. cp file1 file2 file3 /mnt/backup Referece:
[https://www.poftut.com/linux-cp-or-copy-
command/](https://www.poftut.com/linux-cp-or-copy-command/)

------
DLA
It depends on how many files you have. Try a cp command and if you get the
argument list too long error you'll need to use a different approach -- shell
script, rsync.

[https://askubuntu.com/questions/217764/argument-list-too-
lon...](https://askubuntu.com/questions/217764/argument-list-too-long-when-
copying-files)

------
databasher
My go-to would be tar:

`$ tar -C $source-dir -c . | tar -C $dest-dir -x`

