Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Aug 2005 18:21:07 -0500 (EST)
From:      "Michael L. Squires" <mikes@siralan.org>
To:        Brian John <brianjohn@fusemail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: moving everything except a directory
Message-ID:  <20050831181255.M85734@familysquires.net>
In-Reply-To: <433DBEC0.1030001@fusemail.com>
References:  <433DBEC0.1030001@fusemail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I use

tar cvf /<directory with a lot of space>/<my name>.tar 1 3 4 5 6 7 8 9 10
cd <new directory>
tar xvf /<directory with a lot of space>/<my name>.tar

I usually do

cd <original directory>
find . ! -type d -print > files.txt
vi files.txt - edit out files I don't want
tar cvfT /<dir with space>/<orig name>.tar files.txt
cd <new directory>
tar xvf /<dir with space>/<orig name>.tar

which lets me copy files beginning with "." in the root of the directory 
(tar will skip these in the root, copies them in subdirectories).

You also have to worry about permissions if there are executables or files 
you don't own in the directory.

There are much neater ways of doing this, but this method leaves a backup 
copy in the tar file.

Mike Squires


On Fri, 30 Sep 2005, Brian John wrote:

> Say I am at ~ and I have 10 directories inside named 1, 2, 3, 4 ,5, 6, 7, 8, 
> 9 and 10.  What command can I use to move everything but directory 2?  What 
> if I wanted to move everything but directories 2 and 7?
>
> I'm not sure how to use the mv command to do this in 1 comand.
>
> Thanks
>
> /Brian
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
>
>



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