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

Re: chmod/chown -R - maybe an ITP



On Mon, Dec 13, 1999 at 03:19:16PM +0100, Russell Coker wrote:
> Do we have a set of chmod/chown programs that will solve these
> problems?  I would like to have versions of them which take a source
> UID or GID.  So we can say "recurse through this directory and change
> the ownership or permissions of files owned by this user".  This will
> make it really easy to renumber UIDs, "nuchown oldUID newUID -R /" !

    #! /bin/sh

    # nuchown.sh
    #
    # $1 - olduid
    # $2 - newuid
    # $3+ - directory/ies to chown

    find $@ -uid $1 | xargs chown $2

note, untested.  should work :)

a gid version is just as simple. a slightly more complicated version
(maybe an hour or two's worth of scripting work) would be able to do uid
and/or gid and/or user/group names as well as numeric [ug]ids.

craig

--
craig sanders


Reply to: