A request for cp flag

Bertram Scharpf lists at bertram-scharpf.de
Mon Oct 17 16:15:45 UTC 2016

On Monday, 17. Oct 2016, 15:59:10 +0100, Matthew Seaman wrote:
> On 2016/10/17 15:50, Manish Jain wrote:
> > I occasionally face a problem while copying contents with cp. The -R 
> > flag of cp takes the source name as this : If the source_file ends in a 
> > /, the contents of the directory are copied rather than the directory 
> > itself.
> > 
> > Could it considered a valid request that an extra flag (perhaps -r) be 
> > implemented that does the reverse : copy out src rather than src/* ?
> You're not going to get anyone to change the behaviour of a core command
> like cp(1) I'm afraid.  For all that you dislike the behaviour when
> copying a directory path that ends in '/' there will be many, many more
> people that have written scripts that depend on that exact behaviour and
> will be exceedingly peeved if those scripts stop working.

Further there are many other programs that behave the same
way (e. g. rsync here).


Bertram Scharpf
Stuttgart, Deutschland/Germany

More information about the freebsd-questions mailing list