Useful shell commands

deleting .svn folders (files)

Sometimes people who use subversion need to delete all .svn folders in their working copy. To use below command you must be in root directory of your working copy and all .svn folders and files will be deleted.

find . -name .svn -exec rm -rf {} \;

:!: Be careful you can not undo this

sending server resource usage by email

Here are commands I found useful:

  • mutt is great program for sending emails from command line
  • df for disks usage stats
  • top for processor usage
  • vnstat for network traffic usage
  • last user login statistic read from /var/log/wtmp file

Complete example using above commands will be:

> (top -b -n 1; df -h; vnstat -d; last) | mutt -s "Resource usage" your.email@example.com

Best is when you use this command in combination with cron:

0 5 * * *    (top -b -n 1; df -h; vnstat -d; last) | mutt -s "Resource usage" your.email@example.com
 
shell/usefull.txt · Last modified: 2008/05/13 11:09 by kodmasin
 
Copyright (c) 2000-2009 kodmasin.net
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki