Shellscriptingnotes

This page has some random shell scripting notes for useful tasks.

NOTE: Please don't laugh at my notes. I know, I know… this is horribly easy and basic stuff. Shut up - I'm new at it. ;)

  • Doing things to multiple files/dirs

A lot of times, you have to change something in many different directories. A good example is having to remove configuration dir .mozilla from every users' home directory). Shell scripting can do this easily.

#!/bin/bash
for file in /home/*
   do
      rm -rf $file/.mozilla/
   done

#EOF

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License