|
Getting Started with Virtual box:
After installing and opening your console looks like this ![]() Hit the Green Arrow | The advantage (big one) of Virtual Box is you get a windowing interface to ACISS. An alternative for old or poor laptops is to use PuTTy (www.putty.org) for a single ssh login window. | ||||||
Booting up the Virtual Machine and logging into ACISS is
shown in the ![]() | |||||||
For Mac Users: Applications-->Utilities-->Terminal.app
| | ||||||
Important Notes
| Basic list of UNIX commands; Try all of these in your shell login. Commands are issued when you see the shell prompt
| ||||||
Directory Structure Basically consists of top level directory and sub directory. For instance everything with a / at the end of this directory listing (ls) is a subdirectory. the exact form the listing is maybe shell or terminal client dependent. | Do this
| ||||||
Basic Shell Commands, pipes and file management If you want similar bash shell commands consult this resource | Details and Examples A shell, like the C-shell (csh), contains a number of internal commands that are generally useful. These commands differ from shell to shell and there area a large number of shell commands and shell scripting examples to follow (see also below) | ||||||
Shortcuts Its important to go through life miniziming keystrokes. For example you really don't want to name a file this_is_what_I_did_today.txt set filec allows for auto file tab completion history command recalls the history of commands in the shell; set history = 8 sets your history buffer to the last 8 command lines to directly recall any previous command type !! Depending on terminal emulation the up arrow will also repeat the previous command. command line subsitution - uses the ^ character in the C-shell | Well okay suppose you actually named your file this_is_what_I_did_today.txt (go ahead and touch that filename for practice). How do you avoid typing out the filestring each time you want to do something with it? (like rm the damn thing). How about cat this (and now hit tab) and that will complete the filename as long as nothing else is named this in your directory; to find the file type ls *tod* or wc this (tab completion) to run wc on that stupidly long filename if you want to execute a command again then type !17 meaning you want to again run the 17th command in your history list : Suppose you have a series of filed names called dataout1, dataout2, dataout3, ... dataout101. Some of these files have the keyword craigup in them. So you might type cat dataout17 | fgrep craigup ---- if you want to do the same operation on file dataout51 the just type ^17^51 and hit that will run the previous cat command on file datout51 | ||||||
Xwindows (real computer scientists hate X; just ignore then, like awk it just fucking works. A very long story here which we will skip. This is a mechanism that will send windows back to your Virutal client. To active this feature then ssh in to ACISS with the flag -X ssh -X username@aciss ![]() | |||||||
Aliases and setup files This is another convenient thing to set up as a short cut. I will use the C shell example which makes use of a file called .cshrc --- any "." file is a hidden file that can only be seen with the ls -a command. The .cshrc file contains a list of aliases that are shorthand to run various commands. Again refer to the stunning video ![]() | a very good alias is this alias rm "rm -i" this allows you to now, by default, feed the -i flag to rm | ||||||
File Operations and file permissions Mostly this is just copying (cp source_file to destination_file), moving (mv), editing (your favorite editor, deleting (rm), etc but in the right panel this shows how to do this on files in other people's directories Files have three kinds of permissions, read (r), write (w) and executable (x) and three kinds of owners: a) you the user/owner, b) a group (this is generally not applicable) and c) the world. Any file which is world writable means that anyone can delete it - however, you have to go out of your way to make a world writeable file. the chmod command is how you modify permissions and you should man chmod for that help file. You can use chmod with just numeric input (see man page) but I find it more intuitive to use the oug convention (other, user, group). | cd ~dkmatter and do ls -l to see permissions Anything that is a directory has a d at the start of the permission string. Most all files by default are world readable or -rw-r--r-- Where chmod does matter is if your editing an executable script (see below) in some text editor and you produce a file called runme.txt --- you want to chmod oug+x to make that an executable file. | ||||||
Shell scripting There are myriad of things that one can do with a shell script which is a shell specific excutable for running a bunch of commands. People that are good at shell scripting a) save a shitload of time and b) generally get good jobs There are at least a billion shell scripting example web sites this one is straightfoward In general shell scripting is a good an efficent way for doing lots of different kinds of file operations through the use of foreach or while loops (see linked documentation) |
Let's do this on ACISS in a C-shell
echo "What the hell is this" > craigshead wc craigshead echo "duh" > cc1 cat cc1 >> craigshead more craigshead mailx -s "really" rasmus@uoregon.edu < craigshead rm craigshead | ||||||
Editing the Command line and Command line file operations There are a lot of shell builtins that are quite useful. These days, most people ignore them and write programs instead. That is a mistake - it is much better to uses these builtins. They include
There are many others. You can man each of these commands for the help pages but they are generally opaque. It is best to just practice on a data file shown as shown to the right. |
First cp ~dkmatter/sciprog/master1.txt .
Now you have trimed the raw data file into scientifically useful input. tail -100 new3.txt | more will let you look at the last 100 lines of the file. ACISS and UNIX system stuff | Here we give you various tools that will help with program compilation, program running, inspecting the state of the system, killing your jobs or processes etc,etc. For system load and performance use the top command. (man top for more info) Disk or memory management --- run these on ACISS and man them to figure it out
To compile and run a fortran progam with extension of .f90 :
The command ldd to run on an executable shows the libraries that are linked to the program. This is sometimes useful if your program can't run because its missing a library. /tmp is the scratch directory cd /tmp puts you there where you can make junk files without tying up system resource. For python
You are not allowed to run large programs on a head node, so you should use qsub to request a compute node" qsub -I Or qsub -X -I Note if you ssh into login.aciss you will not be on the headnode. Your assigned node will be contained in your prompt (might depend on shell). For example, in C-shell in this sessinon I have been assigned node cn2. Note that /tmp space is node dependent so one node's /tmp space is not another node's /tmp space. Therefore, keep track of the node your on in the shell prompt. Craig Wisdom here and Examples:
|
Now try this python example:
How Computer Scientists Talk to Each Other |
|
the links to material in the right pane are for
more advanced stuff | These are quite useful if your using a UNIX workstation full time but generally not needed in the command line environment. |
|