linux-shortcuts.txt ------------------- to bring up a terminal: in background area on screen, hold down MB3 (right button) select "Open Terminal" to see what directory you are in now: pwd to see what is in that directory ls -la **those are "el" characters, not one's!!** To make a directory: mkdir TestDir To change to a new directory in the current one: cd TestDir To "go up" to a directory above where you are cd .. To go to your HOME dir (the top of all *your* dirs) cd Command line editing: line recall and edit: with arrow keys in keypad file completion: type part of file name, press tab - it will complete file name if unambiguous - press again: will show you alternative completions (if any) copy/cut/paste -- all with mouse (no need for menus, keystrokes) copy: MB1 (left) -- press, drag to mark paste: MB2 (middle) where you want it to go cut: mark with MB1, then MB3-MB3 in quick succession Note: as soon as you "mark" text, it is already copied! grep -- to find strings in files Ex: find all lines with "setID" in files that end in .java in the directory src/Min grep -n setID src/Min/*.java emacs run in background: emacs notes-050114.txt & (the & tells linux to run program in background) run emacs just once, then use File->NewFrame to edit multiple files at once File->OpenFile: prompt at bottom of window: use file completion! Ctrl-MB1 (left) -> selection of files you are editing Save buffer before compiling Quit via File->ExitEmacs (***NOT*** with X in upper left) ============================================================== Its a good idea to establish "notes" files to keep notes about commands, about programs, etc. Eg: emacs notes-060108.txt & Then copy/paste into and out of that file. Add text notes to yourself and maybe a date marker for entries. Use files for - notes about linux - notes about java - notes about repast - notes about a particular program/model you are working on - notes about a series of experiments ** Use copy/paste to put the actual commands that you enter, and the (relevant) output that you get. That way you can re-run the command by just doing another copy/paste -- save typing time -- reduce mistakes Example entry: 2006-01-08 ---------- How to find a string in a set of files matching the patterns *.java (in the src/Min subdirectory) and *.txt (in the current directory) grep -n setID src/Min/*.java grep -n "a phrase" *.txt How to make a printout like this one: enscript -2rG -T4 /users/rlr/Courses/530/Handouts/linux-shortcuts.txt How to find out what all those parameters on that enscript command mean: man enscript --------------------------------------------------- Here are a couple of links to unix/linux tutorials: http://www.ee.surrey.ac.uk/Teaching/Unix/ http://www.isu.edu/departments/comcom/unix/workshop/unixindex.html and there are zillions more on the web. For a short intro to using linux at cscs, see: http://cscs.umich.edu/lab/documentation/intro-Unix.txt If you are new to linux, do the commands/exercises yourself, to see it "in action" -- note the example program is in C, but you don't really need to know any C to carry out the example, and the important parts are to see how the linux commands work (mkdir, cp, emacs and so on). NOTE: If you see references to CSCS machine addresses like this: lastrada.physics.lsa.umich.edu ^^^^^^^ change the "physics" to "cscs" to get to our machines. ---------------------------------------------------