Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: copying a directory to same level



On Saturday 21 of August 2010 19:12:37 zzapper wrote:
> Hi
> (Hope this is not too dumb)
> 
> I want to duplicate directory vim73 to vim
> 
> >cp -r vim73 vim/
> 
> if directory vim does not exist then it does what I want.
> However if vim/ already exists then vim73/ will be created as a
> sub-directory in vim/ eg vim/vim73
> 
> Can you explain this behaviour

This is how cp command works and is unrelated to shell.

> and how can I force it duplicate to
> same level regardless of whether directory exists

GNU cp has -T option that does exactly what you want.

Attachment: signature.asc
Description: This is a digitally signed message part.



Messages sorted by: Reverse Date, Date, Thread, Author