BISMG:SarahS/handy stuff

How to setup a Cron job

 * Use holocene as it communitates with the outside world
 * In the home directory open crontab using : crontab -e or (-l to list what is in crontab)
 * Alternatively, crontab file is located in /tmp
 * Specify the editor : export EDITOR=/usr/bin/emacs to get editor for crontab
 * Set the time to run the script by filling in the blocks. For example run send and email at 18:10 everyday
 * 18 10 * * * /home/ggsrs/automat/send_an_email.sh

Handy commands

 * find . -iname '*.xml'
 * list the number words and lines in a file wc -filename
 * killall my program
 * Search for functions with a binary nm simple_glide | grep functionname

Compress and un-compressing using tar (.tgz)

 * find all files with size > 100k and write to a list find: ./tests/*/*/*.nc -size +100 -print > test_filenames


 * Compress all files in the list: tar -cvzf mytarfile.tgz -T test_filenames


 * Un-compress files : tar xvzf mytarfile.tgz

Finding info on machine architecture

 * cat /proc/cpuinfo
 * Return the number of CPU's grep 'physical id' /proc/cpuinfo | sort | uniq | wc -l
 * Return the number of nodes cat /proc/cpuinfo | grep processor | wc -l
 * Note cpuinfo is very confusing because nodes are called processors.