Introduction to Linux ##################### Contents ######## 1. Getting started on our Linux computer 2. Basic introduction to Unix (from Melbourne) 1. Getting started on our Linux computer ######################################## 1.1 Astro software ################## To use Astro software (in "/scisoft") put this in your .bashrc file: # Astro add-on packages ############################ # # Scisoft if [ -f /data1/bin/Setup.bash ]; then . /data1/bin/Setup.bash fi # # Pgplot and Configure export PGPLOT_DIR=/scisoft/pgplot export PGPLOT_DEV=/xwin if [ $?LD_LIBRARY_PATH ]; then export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/X11R6/lib:/scisoft/pgplot:/home/mjd/tmp/aao_configure_r4_1 else export LD_LIBRARY_PATH=/usr/X11R6/lib:/scisoft/pgplot:/home/mjd/tmp/aao_configure_r4_1 fi # # end of add-on packages ########################### To compile Fortran code with PGplot (the mjd library is for my code specifically) g77 -o raplot raplot.f -L/home/mjd/lib/ -lmjd -L/scisoft/pgplot/ -lpgplot -L/usr/X11R6/lib/ -lX11 1.2 IRAF ######## To setup IRAF: cd to your home directory type "mkiraf" answer "xgterm" to the terminal question To run IRAF: start a terminal "xgterm &" start a display "/usr/local/bin/ds9 &" (using just "ds9 &" will give you an older version from scisoft) cd to your home directory type "cl" type "display dev$pix 1" (to check display) http://iraf.noao.edu/ 1.3 ds9 image display ##################### To get the latest version start it as /usr/local/bin/ds9 & To access DSS images directly in the "analysis" menu, you must set up a proxy server like for a web browser: in Edit/Preferences/HTTP... 1. select "use proxy" 2. set proxy host = "proxy.physics.uq.edu.au" 3. set proxy port = "3128" 4. click OK in Edit/Preferences 1. click "save preferences" <- VERY IMPORTANT! 1.4 Directories ############### When you log in you get the same home directory as on the main Physics computers. For data storage and processing you should use the local disk /data1/. Please make a directory for yourself on data1 as follows: cd /data1 mkdir username 1.5 Tape Backups ################ The sizes of DAT tapes are: DDS2 4Gb DDS3 12Gb DDS4 20Gb HINT: if you have trouble reading DAT tapes written elsewhere (especially on Sun computers) try the following command first: mt -f /dev/tape setblk 0 WARNING: it is your own responsibility to make backup copies of your files. On the main workstation you can copy files to the DAT tape drive as: tar -cvf /dev/nst0 FILE (if FILE is a directory, this copies all its contents inc. subdirectories) mt -f /dev/nst0 rewind mt -f /dev/nst0 eject tar -xvf /dev/nst0 (this lets you read a tape to the current directory) 2. Basic introduction to Unix ############################# (Written for Melbourne so some will not apply) 1. in the login screen, type the login username & press `enter' 2. type in the password, press `enter' --> `xterm' windows should appear 3. to find out which directory you're in, in an xterm window type `pwd' after the > sign, press `enter' (pwd stands for `print working directory') 4. to make your directory, type `mkdir name' after the > sign, press `enter' 5. to change to your directory, type `cd name' after the > sign, press `enter' 6. to check where you are, type `pwd' after the > sign (assume press `enter' from now on!) 7. to see which files are in this directory, type `ls' (assume after the > sign from now on!) 8. to start a new file to work on, type `emacs filename &' to bring up an emacs window 9. type whatever in the window, L mouse hold on `Files', then select `save Buffer' to save your work 10. to exit emacs, L mouse click on `Files', then select `Exit Emacs' 11. to work on any file, type `emacs filename &'. You can have more than one file open at the same time 12. to edit (undo, cut, copy, paste etc), highlight the relevant text, then select from `Edit' 13. you will see that emacs creates a backup file as you go called `filename~' ** remember to save your work often when working in an emacs editor 12. two ways to print a file: a. in an xterm, in the correct diectory, >lpr filename b. in the emacs window, L button hold on `Tools', move to `Print', select either `Print Buffer' or `Postscript Print Buffer' Basic Unix Commands: -------------------- pwd -find out which directory you're in ls -list files in the current directory mkdir [dname] -make a diectory called `dname' cd -to go to the `home' directory (/home/guest/) cd [dname] -to go to the directory called `dname' cd ../ -to move up one directory level rm [fname] -remove the file called `fname' (you're asked to confirm) rmdir [dname] -remove directory called `dname' (you're asked to confirm) cp [name1] [name2] -make a copy of file called `name1' and call it `name2' mv [name1] [name2] -to rename a file called name1 as name2 emacs [fname] & -bring up an emacs editor to work on file called `fname' lpr [fname] -to print the file called `fname' from the xterm window wc [fname] -counts lines, words, characters in a file more [fname] -displays the file in the xterm, press spacebar for more, Ctrl-C to end cal -diplays this month's calendar cal 02 1999 -displays the calendar for Feb, 1999 (try 09 1752) (up arrow) -displays previous command Logging out ----------- 1. close everything you've got open, eg netscape and emacs windows 2. all xterm windows should be at the prompt (> sign) 2. R mouse button on the screen background, move to `Exit', release Using Netscape -------------- two ways to get netscape: a. in an xterm, >netscape & b. with the cursor on the screen bakground, hold down the R mouse button, move to `Programs', `Browsers' then `Netscape' and release the button. Other Functions --------------- With the cursor on the screen bakground, hold down the R mouse button, move to `Programs', the `Calculator' or `Games' etc.