bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New feature request for cp to flatten directory


From: Bob Proulx
Subject: Re: New feature request for cp to flatten directory
Date: Fri, 7 Dec 2007 09:50:34 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

Eric Blake wrote:
> Todd Andrews wrote:
> > I'd like to suggest a new feature be added to cp called --flatten that
> > would remove all paths from the source files/directories and copy the
> > file to the destination directory.
> >
> > cp -pr --flatten data -t alldata
> 
> Thanks for the suggestion.  However, it seems like this is already
> possible with existing tools, so why add the bloat?
> 
> find data -type f -exec cp -pr -t alldata {}+

A very minor correction for the mail archive and an update.  There
needs to be a space between the "{}" and the "+".  Plus since every
argument will be a file because of the "-type f" then no cp "-r"
option is needed.

  find data -type f -exec cp -p -t alldata {} +

[Eric knows this but looks to have been caught by the very early in
the morning time of posting.  :-) ]

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]