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

Re: Help with command - cp



On 1/27/14, Lisi Reisz <lisi.reisz@gmail.com> wrote:
> I am wanting to use the CLI to copy some files from dirA to dirB.  I
> want to exclude all hidden files.  Will this command achieve it? :--
>
> cp -Rp /path/to/sourcedir/A/* /path/to/destinationdir/B

BTW, with GNU ls, -r is the same as -R, but doesn't require pressing <Shift> :)

Your command will exclude files and dirs beginning with period ('.'),
in the directory /path/to/sourcedir/A/
but not "hidden" files in subdirectories (I note your -R/-r option).
If you really are only copying files, then -r is not needed.

Good luck
Zenaan


Reply to: