On 26/01/14 14:26, Lisi Reisz 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

Thanks,
Lisi


If you don't put a / after B it will copy all files to a file called B

So your above

cp -Rp /path/to/sourcedir/A/* /path/to/destinationdir/B


Should be

cp -Rp /path/to/sourcedir/A/* /path/to/destinationdir/B/
Also when using rsync, i use the following

rsync -vrthiP --progress --stats  source/ destination/

This also checks for and only updates changed files on any subsequent rsync from A to B

Don't forget the / at the end, even rsync will copy everything to a file rather than the wanted directory if you miss of the /

If you want to copy the folder A to the second source folder and keep the A name

rsync -vrthiP --progress --stats /path/to/source/A /path/to/source/

No / after A and no B after the last source/

If you only want to rsync the contents of folder A to folder B then put a / after A


:)


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/52e5766f.7000...@yahoo.com

Reply via email to