Re: RM Help

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



On 10/26/2010 05:23 PM, Matt wrote:
> Is there a way to tell rm -f to only remove a file if its owned by say mail?

Not sure you can directly use rm for that, but you could find the uid of 
the user in /etc/passwd, then run find and -exec on it with rm.

To view them:

cat /etc/passwd | grep "USER"

find /path -uid 123 -exec ls -la {} \;

To delete them, then use -exec rm -rf {} \;

Be CAREFUL though!

Regards,
Max
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux