[TUHS] moving directories in svr2

John Cowan cowan at ccil.org
Fri Dec 31 04:02:27 AEST 2021


On Thu, Dec 30, 2021 at 12:15 AM Dan Stromberg <drsalists at gmail.com> wrote:

FWIW: in the old days, I just used  tar cf - . | (cd some_place_else; tar
>> xvpf - )  preserving permissions.
>>
>
In the new days, rsync -a dir1/ dir2 is the ticket (derived from "is
etiquette", if you can believe it).  You need the terminating slash to
prevent dir1 from becoming a subdirectory of dir2; dir1/* would of course
not copy dotfiles.  (I grew weary of typing "cp -r dir1/.[a-zA-Z]* dir2" to
copy dotfiles and dotdirectories left behind.)  The -a flag ensures
permissions, symlinks, etc. are preserved.

If you rsync more than once, only the files in dir1 that have changed are
copied.  You can also use user at host:path as either argument to make it
work over ssh, which is the common use case.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20211230/000f6f95/attachment.htm>


More information about the TUHS mailing list