2

I want to copy a file from drive A to drive B, preserving the file's path. For instance

/A/x/y/z/file.txt to /B/x/y/z/file.txt

However, you cannot cp a file to a directory that doesn't already exist. I searched and saw some results for moving whole directories using paths, but in my use case I need to be able to do this by specific individual files.

In my example above assume /B contains no directories currently, and so I would need to create x/y/z before the cp command would be successful. The string that I have to work with is the full current file path, /A/x/y/z/file.txt

0 Answers0