[K12OSN] Script to flush down the drain files from every user home...

Huck dhuckaby at paasda.org
Fri Jun 20 20:26:52 UTC 2008

The succinct way would be
  cd /home/${x}/.Trash && rm -rf *
(&& means continue if the previous command succeeded)
or just
rm -rf /home/${x}/.Trash/*
as long as the expansion fits in the command line size limit.

that's a quote from Les(from a different scripting question)... you are 
correct Robert!

Robert Arkiletian wrote:
> On 6/20/08, Huck <dhuckaby at paasda.org> wrote:
>> !#/bin/bash
>>  for x in `ls /home`; do
>>  echo "Doing $x ..."
>>  cd /home/${x}/.mozilla/firefox/*.default/Cache
>>  rm -Rf *
>>  done
>>  that was one from a while back...
>>  change the path in the 'cd' line from
>> .mozilla/firefox/*.default/Cache to whatever you want..
> If the cd fails you might rm -Rf something you don't want to. Better
> to rm the full path instead of cd to it. I thinkthis  issue  came
> before too. Maybe it was Les who warned about it.

More information about the K12OSN mailing list