[Novalug] Is there a way to do do a 'cp' like a 'mkdir -p' on a file?
igor_birman at yahoo.com
Thu Feb 12 09:22:55 EST 2009
`rsync -R /my/server/username/projects/file.txt .`
From: Brandon Saxe <brandon20va at yahoo.com>
To: novalug mailing list <novalug at calypso.tux.org>
Sent: Thursday, February 12, 2009 8:46:49 AM
Subject: [Novalug] Is there a way to do do a 'cp' like a 'mkdir -p' on a file?
I am trying to make it so I can copy a single file (or a directory), but basically a single source and create it's entire path wherever I am copying it to.
I want to be able to do something like this (assume I'm in /home/user):
`cp --some-special-option /my/server/username/projects/file.txt .`
and end up with
without having to first create the parent directories, and all in one command line.
Is there a way to do this?
I'm thinking there might be a way by using tar/untar and running through pipes, but want to know if there is an easier way.
What I'm trying to achieve is a super simple way to 'checkout' a file from another location (with paths intact) without using any sort of repository. I want plain filesystems only.
Novalug mailing list
Novalug at calypso.tux.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Novalug