[UFO Chicago] very newbie 'nix question
Elliot Shank
clonezne@galumph.com
26 Jan 2002 16:16:07 -0600
On Sat, 2002-01-26 at 15:10, John Kilbourne wrote:
> Now that I've met you guys and feel comfortable, I can reveal the
> depths of my true ignorance. I want to move a directory full of files
> from one place to another. My reading of man mv tells me it only
> operates on files. How do I move a directory; the files don't have a
> suffix or other common element in the name.
On a related note is one of my beefs with using "cp -R" on directories
when some of the target directories already exist. cp just barfs in
such a case and gives up. My usual workaround in such a case is to
cd sourcedir
tar cf - . | ( cd destinationdir && tar xvf - )
since tar doesn't whinge about pre-existing directories. (Yes, I know I
could use -C parameters to tar to not have to do the cd's.)
Word to the wise-- Nautilus will trash the existing contents of existing
subdirectories of the destination if you use drag and drop to move an
existing source directory. (You'll be prompted first, but it doesn't do
the tar-like merging of new and old content that MS Windows Explorer
does in such a case.)