On Tue, Jun 19, 2007 at 06:14:16PM -0600, Bob Proulx wrote:
> Simon wrote:
> > OK.. So i was in my /root/ directory and put just one too many "."s in
> > the line... Now i have a lot of files that i own!!
> >
> > I think the term is "DOH!".
> >
> > Is there any way to fix these?
>
> Personally I would install a chroot on my system, install in the
> chroot all of the packages that I have installed in the root system,
> and then compare the ownership of all files between the two. Using
> that information I would fix the parent system. When done, remove the
> chroot. Here is some reference documentation.
>
> http://www.debian.org/doc/manuals/reference/ch-tips.en.html#s-chroot
You shouldn't have to compare and chown manually...
Once you've installed the chroot (e.g. in /mnt/foobar) then this should
do the trick:
# cd /mnt/foobar
# find . -print0 |
xargs --max-args=1 -I@ -0 -- \
chown --reference /mnt/foobar/@ /@
(double-check the syntax - this is from memory)
PS: Considered restoring from backups?
Hope this helps
--
Karl E. Jorgensen
karl@jorgensen.org.uk http://www.jorgensen.org.uk/
karl@jorgensen.com http://karl.jorgensen.com
==== Today's fortune:
The worst sin towards our fellow creatures is not to hate them,
but to be indifferent to them; that's the essence of inhumanity.
-- G. B. Shaw
Attachment:
signature.asc
Description: Digital signature