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?

To this I really want to write the one word answer of "Yes."

So yes to what you asked to try as well as consider using tar. The tar command is older than a lot of users yet I find Linux users ignoring tar. I can't explain why.

Still probably better to put it in a script file even if you only have to do it once. That way you can check for typos. The more file names you type the higher the chances of typing one incorrectly. Type - proof read - execute.

What about a script that assembles all the file names and concatenates then together before executing the single cp command.

commented: That sounds like tar with extra steps (nod to Rick and Morty memes.) +15
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.