Subject: Re: bug#9611: Copy an item with its parent directory
From: Pádraig Brady <[email-masked]>
To: Peng Yu <[email-masked]>
Cc: [email-masked]
Date: Tue, 27 Sep 2011 14:29:07 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

tags 9611 notabug

On 09/27/2011 02:23 PM, Peng Yu wrote:
> Hi,
> 
> Suppose I have a file 'a/b/c/d/e/f', I want to copy it to 'target'
> with the parent 'd/e'. I.e., the resulted file is 'target/d/e/f'.
> 
> I can make a bash script to do so, but I wondering if there is an
> existing command or option. Thanks!
> 

(cd a/b/c && cp --parents d/e/f /path/to/target)

cheers,
Pádraig.