[Cialug] Need assistance with chown and find commands

Paul Gray gray at cs.uni.edu
Thu Dec 19 13:10:30 CST 2013


On 12/19/2013 12:55 PM, Tim McLaughlin wrote:
> there are or a few different ways to do what you want,
> 
> the find command has a -exec option.
> 
> or something like:
> 
> findarray=`find ./* -user userA`
> for each in ${findarray[@]}
> do
> `chown userB $each`
> done
> 
> --Tim

find . - -user userA -exec chown userB {} \;

No need to catch and spawn.


-- 
Paul Gray                                         -o)
314 East Gym, Dept. of Computer Science           /\\
University of Northern Iowa                      _\_V
 Message void if penguin violated ...  Don't mess with the penguin
 No one says, "Hey, I can't read that ASCII attachment ya sent me."


More information about the Cialug mailing list