[K12OSN] shell script to remove contents of several files

cliebow at midmaine.com cliebow at midmaine.com
Fri May 19 11:53:53 UTC 2006

you could cd /var /mail or something
and ls>/tmp/users to get a list of people
then read em one at a time
cat /tmp/users|while read userdude ;do
rm -rf some stuff from $userdude
echo "removing junkies from $userdude"
roub but you can adapt iy to suit
> Hello All,
> Due to the fact ,that I am not smart enough, would someone be able to
> give an example of a shell script that would remove the contents of each
> users, email folder,( but of course leave the user's folder on the
> system). I'm wanting to "clean out" everyone's email at the end of the
> school year.
> In other words something like delete contents
> of /var/mail/allusers<folder contents>.
> I'm not sure of correct syntax of "rm" or "shred"
> Thanks again,
> Barry Cisna
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>

More information about the K12OSN mailing list