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

Re: Help with command - cp



On 1/27/14, Mathias Bauer <mbauer@gmx.org> wrote:
> * Felix C. Stegerman wrote on 2014-01-26 at 23:58 (+0100):
>
>> On 2014-01-26 23:24, Mathias Bauer wrote:
>> > * Mr Smiley wrote on 2014-01-26 at 20:56 (+0000):
>> >
>> > > > cp -Rp /path/to/sourcedir/A/* /path/to/destinationdir/B
>> > >
>> > > If you don't put a / after B it will copy all files to a
>> > > file called B
>> >
>> > No, obviously not.
>> >
>> > [...]
>>
>> It does if there's only one file in A and B does not exist.
>>
>>   $ mkdir A; echo HI >> A/foo
>>   $ cp -a A/* B
>>   $ cat B
>>   HI
>
> Yes, but ... come on, that's a rather trivial shell expansion!
> By the way, don't you consider it a little bit strange to change
> the original problem conditions *afterwards*?
>
> * Lisi Reisz wrote on Sun, 26 Jan 2014, at 14:26 (+0000):
>
>> I am wanting to use the CLI to copy some files from dirA to
>> dirB.  I want to exclude all hidden files.
>
> Read ... file*S*.

Now come on ... there is no reduction in functionality by appending
'/', and yet there is the advantage of training the fingers in a way
that _actually_helps_ in certain potential other cases. That's all I
and others are saying. I personally have been bitten at least twice in
20 years by _not_ appending '/' after my destination _directory_name_
...

Henceforth we shall limit all responses to the question, only the
question, and nothing but the OP's precise question! Or else! All
contributors beware.

:)


Reply to: