Copy a file from source directory to target base directory and maintain source path
- by Citizen Dos
Forgive me, I am probably not using the right terms to describe the problem and misunderstanding the most basic usage for a couple of common commands.
I have a simple find statement that is locating files that I want to copy. I want to tack on the -exec cp {} and have cp copy the file from the source directory to a new base directory, but include the full path. For example:
"find . -name *.txt" locates /user/username/projects/source.txt
"cp {} [now what?]" copies the file to /user/newuser/projects/source.txt