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?
Recommended Answers
Jump to PostWhat about a script that assembles all the file names and concatenates then together before executing the single cp command.
Jump to PostDo not need write script for this. Actually its a single line command e.g.
You have directorydir1
which contains multiple files anddir2
which is target to copycp dir1/* dir2/
copy all files
All 6 Replies
rproffitt 2,701 https://5calls.org Moderator
samueltarcin999 0 Newbie Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Dani 4,653 The Queen of DaniWeb Administrator Featured Poster Premium Member
rproffitt commented: That sounds like tar with extra steps (nod to Rick and Morty memes.) +15
Shyal_Beardsley 0 Newbie Poster
AndrisP 193 Posting Pro in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.