[K12OSN] Quick way to empty student folders
eharrison at mail.mesd.k12.or.us
Fri Sep 17 01:05:14 UTC 2004
On Thu, 16 Sep 2004, Chris Hobbs wrote:
>Jim Christiansen wrote:
>> Lat year I used some method to empty student folders... What ever it
>> was I can't think of it.
>> Has anyone used a quick way to empty the contents of all of the
>> folders in /home/usernames ?
>> I need to keep all of the student folders in /home, but everything in
>> them needs to go...
>for i in /home/*; do rm -rf /home/$i/*; done
>NOT TESTED -- POSSIBLY DANGEROUS -- COULD CAUSE GLOBAL WARMING
>OK, you're on your own if you run it, but it makes sense to me...
I didn't test this either, but I do see one error. This would be
(closer to) correct:
for i in /home/*; do rm -rf $i/*; done
NOT TESTED -- POSSIBLY DANGEROUS -- COULD CAUSE AN ICE AGE ;-)
More information about the K12OSN