Page 1 of 1

Find a delete all the files owned by a user

Posted: Sun Jul 01, 2012 4:13 pm
by a24uall
Here we will see how to delete all the files owned by a user named "nivedha" from the /tmp folder
cd /tmp
find /tmp/ -type f -user nivedha | xargs rm -f

Re: Find a delete all the files owned by a user

Posted: Mon Aug 27, 2012 1:54 pm
by a24uall
Another method is
cd /tmp

Code: Select all

for i in `find /tmp -user ncuysoog`; do rm -f $i; done