Results 1 to 3 of 3

Thread: Copy bulk Files in Linux

Hybrid View

  1. #1
    Join Date
    Mar 2019
    Posts
    12

    Copy bulk Files in Linux

    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?

  2. #2
    Join Date
    Feb 2014
    Location
    Riviera Beach, Maryland, USA
    Posts
    86


    cp -a /source/. /dest/

    The -a option preserves all file attributes as well as symlinks. And the . at end of the source path is like a wild card telling cp you want to copy all files and folders, included hidden ones.

  3. #3
    Join Date
    May 2019
    Posts
    7
    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/

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •