M171 - Collins
HOW-TO-DO ESSENTIALS
( Everything you need to start )
-------------------- Unix --------------------
You need to know about a dozen commands to function in any operating system. Unix commands are short and mnemonic and very natural. Most of them take various -flags to modify their action. You can use alias newname something to name "something" to "newname". e.g. alias cp 'cp -ip' All aliases and customizations may be placed in your .cshrc file. In general, command -h shows the usage (syntax) man command will tell you more than you want to know! Here is a list of the essential commands [and useful aliases]: ls = list [ alias l 'ls -FC' ], [ alias dir 'ls -lF \!* | more' ] cp = copy [ alias cp 'cp -ip' ] mv = move, rename [ alias ren 'mv -i' ] cd = change dir rm = remove (delete) [alias rm '/bin/rm -ir'],[ alias del /bin/rm ] lpr = print file vi = visual editor (the standard Unix editor, see below) more = display a file page-by-page mkdir = make dir rmdir = remove dir man = manual (help) on a command chmod = change mode of file (set permissions) logout = log off the machine telnet = log on to another machine ftp = file_transfer_protocol, transfer files between machines ~ refers to the home dir, . to current dir, .. to parent dir There are hundreds of other commands/tools, do: xman to see them.
-------------------- vi editor --------------------
vi filename starts vi on the file, you'll be in command mode ZZ write (save) and exit :q! quit (exit) without saving h, j, k, l move cursor left, down, up, right H to top of page L to bottom of page ^F page forward ^B page backward 1G to top of file G to bottom of file i insert ...ESC a append (after cursor) ...ESC o open new line ...ESC O open new line above cursor...ESC x delete character dw delete word dd delete line There are many,many more commands and customizations, but these are the most essential. There is also a public domain vi for DOS.
-------------------- Zip/Unzip --------------------
Best compress/archive utility. zip -h , unzip -h show the options. I use the following aliases: alias zp 'zip -oyz' #preserve date,skip links,ask for comment alias zpm 'zip -oyz9m' # also -m: delete zipped files alias zpmr 'zip -oyz9mr' # also -r: recurse into subdir's alias zl 'unzip -l' # list zipped files alias uz unzip
-------------------- e-mail --------------------
mail user@address (end message with . on a newline) Commands within mail (at $ prompt): h = headers (current msg is indicated by > in 1st column) p = print current msg on the screen r = reply to the current msg d = delete current msg s = save current msg to a file ~r = read a file into msg (when composing a msg) ~v = vi the current msg q = quit mail
-------------------- X Windows --------------------
Each window is an xterm, emulating a terminal. A window manager (such as twm or fvwm) manages all the windows and the mouse. The mouse actions and menus are specified in a file (.twmrc or .fvwmrc) which can be customised. Defaults are in .Xdefaults. You can set the colors, font, size, etc. The greatest thing about X is that you can run on a remote machine and display its output on your screen ! All you need to do is: - tell your local machine to accept the remote one as host: local> xhost +remote_address - tell the remote machine (telnet to it) to display on the local one: remote> setenv DISPLAY local_address:0
-------------------- Fortran / C --------------------
f77 code.f compile Fortran code.f and produce executable a.out cc code.c compile C code.c and produce executable a.out
-------------------- Run a code --------------------
In your code use: read* to read values from standard input print* to write values to standard output The standard input/output device is the screen, unless redirected, e.g. a.out will read and write to the screen, but a.out < dat > out will read from "dat" and write to "out".
-------------------- Plotting --------------------
Simplest, nicest (and free) plotting tool ever is: gnuplot Start gnuplot with: gnuplot, then do: help plot , help set Everything is on line, nothing to remember !!! Try this: gnuplot> plot [-4:4] sin(pi*x), cos(pi*x/2) with points You can get the DOS version for your PC from the Mathematics Archives (netscape http://archives.math.utk.edu ,click on Software;MSDOS;graphing).
------------------ Exploring the Internet ------------------
Web browsers (xmosaic, Netscape, etc) are amazing pieces of software that have caused the explosive growth of the Internet since 1993. You can visit the World Wide Web and amaze yourself with what is available out there. Try these to start with: netscape http://www.math.utk.edu/~ccollins (my page) netscape http://www.math.utk.edu (Math Dept page) You can access the boundlesss resources of the WWW, such as the 1st ever hypertext electronic book, the DOE-funded, ORNL-developed COMPUTATIONAL SCIENCE EDUCATION PROJECT (CSEP). Access the WWW page for this course: netscape http://www.math.utk.edu/~ccollins Click on Math 171 and do the following: Exercise 0: Click on `BookMarks' then click on `Add BookMark'. Ever after, you can type: netscape, click on BookMarks, and click on: `Math 171 - Collins - UTK/Math' You'll find all class assignments posted on that page. Take a BRIEF look at Assignment 0 (click on it to see it). Keep going back... Exercise 1: Start working on Assignment 1 immediately...