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:
#!/bin/bash
for f in `ls *csv | awk '{print $2}'`
do
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
done 

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

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 jiansen6@glacier.westgrid.ca:/global/home/jiansen6  glacier

b)  create following rsync_jiansen.sh file:

#!/bin/sh

# 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/rsync_jiansen.sh
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:
run
where
bt
backtrace
9. find local IP address
ipconfig
10. For IP to host
nslookup 142.90.100.193
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:
  ctrl+shift
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