Useful Commands

1. cut the first column of test1.h
cut  -d\  -f2- test1.h
2.Print second column: awk '{print $2}'
3. shell script:
for f in `ls *csv | awk '{print $2}'`
echo $f
echo Vancouver > Tor$f
grep Geography "Table "$f >> Tor$f
#every line end with 535
grep ^535 "Table "$f >> Tor$f
cat Tor$f |col -b > Tor$f.txt
rm Tor$f

4. link to boost library in WestGrid:
Link to boost library header file in

g++ -I/global/software/boost-1.33_1 example.cpp
5. Use cron job backup files to remote computer

a) mount remote computer to local  computer
sshfs  glacier

b)  create following file:


# Sync all data from locate to remove

export LOG=/Users/jiansen/log_dir/jiansen_backup.log

echo `date` > $LOG
echo "Starting copy of /Users/jiansen/working_dir to glacier.." >> $LOG

rsync -a -E -4 -u --exclude=.tmp --exclude=.o --stats --progress /Users/jiansen/working_dir \
/Users/jiansen/glacier >> $LOG

echo "Backup of Documents to WestGrid complete..." >> $LOG
echo "" >> $LOG
echo `date` >> $LOG

exit 0

After you add in /etc/crontab

 15 17 * * *  /Users/jiansen/
you may need to run: crontab /etc/crontab
You can check if your cron job running via:
crontab -l

6. Search in pine: w
7. Add a user in Linux:
useradd -G bio,phys -s /bin/csh -c "Jiansen Lu" -m jiansen
8. GDB command:
9. find local IP address
10. For IP to host
11. shell window in Windows
You can do this from the Start menu by choosing Command Prompt (Windows XP), or by choosing Run... and then entering cmd.
12. Repeat last submitted line in IDLE
Alt + P = History Previous
Alt + N = History Next
13 Turn off red key in Toshiba laptop:
14. Window commnad Prompt in Windows
Click start, type cmd  in search box
15. Task manager for remote computer in Windows
local computer, CTRL+ALT+DELETE, remote computer type taskmgr in search box after clicking start
16 audacity
view->zoom in.  edit->remove audio->split delete,  effect->Truncate silent