I would like to copy a file to a folder that does not exist by having cp
create the destination folder and placing a source file into it. Is this possible?
So here is an example, I have a file on my desktop called temp.file
. I would like to do this:
cp temp.file ./createThisFolder/
I looked through the man pages and didn't see anything. The reason I want to do this is because I want to run a test on the directory later on. If the directory doesn't exist I know there are no files waiting for me.