[nflug] ubuntu sudo script

Justin Leitgeb justin at phq.org
Thu Jun 21 12:21:13 EDT 2007


joshj at linuxmail.org wrote:
> for i in `find -name *wine*`; do sudo rm -f $i; done 

I think you'll need a second "sudo" in the above script to make it work 
the way you want.  If find doesn't have permissions to enter a 
particular directory it won't be able to populate the list of files to 
remove across the entire filesystem.  Try this:

for i in `sudo find . -name *wine*` ; do echo sudo rm -f $i ; done

Take out the "echo" when you're sure that the list is safe to delete.  
If this were on my system, I would probably use rm -i or rm -I instead 
of the -f option if possible, because of previous mistakes I've made. ;)




More information about the nflug mailing list