Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Mar 2005 22:49:45 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Joachim Dagerot <jd@dagerot.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Moving a directory hierarchy - best practice?
Message-ID:  <20050304204944.GC753@gothmog.gr>
In-Reply-To: <200503042035.j24KZCMv023724@mail-core.space2u.com>
References:  <200503042035.j24KZCMv023724@mail-core.space2u.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2005-03-04 21:35, Joachim Dagerot <jd@dagerot.com> wrote:
>
> I have spent 20 minutes or so googling around to find the best way to
> _move_ a complete directory hierarchy. But must admitt that I haven't
> foundmany good answers.
>
> The best suggestion was from
> http://badgertronics.com/knowledge/one.adp?parent=25:
>
> To move /tmp/blarg to /var:
> % cd /tmp
> % tar cvf - blarg | (cd /var; tar xf -)
>
> I bet there must be atleast one utils like a binary named "mvdir" or
> similar that simply taked two directory names as argument. But I can't
> find any.
>
> How do you guys move around your directory structures from prompt?

I have used the following many times, with very good results:

	# cd /source/path
	# find . | cpio -p -dmvu /destination/dir

The "pass through" mode of cpio(1) works on at least the following
systems that I have used it:

	- Linux
	- BSD
	- Solaris

The first two use GNU cpio(1).  The second uses the system cpio(1),
at least in the versions I have used.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050304204944.GC753>