[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Moving files to a new partition. Please help.

> Thank you all for your help, but the command I ended up using was this:
> cd /mnt
> find ./ | grep -v ./mnt | grep -v ./proc | cpio -p

Well, we're well off the topic of "Debian", not to mention Linux-specific
problems, but....

you could have replaced the "grep -v ./mnt | grep -v ./proc" with just
'egrep -v "./mnt|./proc"'. Now, *unfortunately*, either of these will 
skip right over any directories named "./mnt2", "./proceedures", or anything
else starting with those two strings. That's why you need the "^" and "$"
in there, like so: 'egrep -v "^./mnt|./proc$"'. Oh, and, while we're at it,
you probably don't want that period to match *any* character, so you 
should escape those: 'egrep -v "^\./mnt|\./proc$"'.

Now, if you wanted to be even *more* fancy, you can do the path exclusions
in the "find" command itself:

 "find ./ ! -path "^\./mnt/|\./proc/" | cpio -p"

Which, MAY or may NOT work. I haven't tried this, but some close cousin
of this set of switches should do the trick nicely. The nice benefit of
this one is that it *might* create the directories for you and ignore all
of their contents. Thus eliminating the need for:

> mkdir proc
> mkdir mnt

- Joe

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com

Reply to: