Jeremy Sanders
October 2011
When you write a program in a computer language like Fortran or C, a `runtime library' deals with the kernel allowing you to use nicer commands to get memory and write files in your language, like WRITE in Fortran or printf in C.
The standard astronomy shell is known as tcsh (Extended C-Shell, as it bears some resemblance to the C language), but other popular ones include the standard sh (Also known as the Bourne Shell) and bash (The Bourne Again Shell). All shells let you run programs by typing in their names, but some have more features. Most shells let you do more complex things like loops and conditional statements, which are very handy when it comes to automating operations. tcsh has lots of flaws, but nevertheless has become the de facto astronomical shell. bash is probably the most popular shell.
Many files in Unix are stored as text; often data in a program are translated into text for saving and loading. Other files, such as those your programs could write, or programs themselves, are encoded such that you can load them back into memory.
Files have particular names, which can be hundreds of characters long, and are case sensitive, so that the file `Hello.txt' isn't the same as the file `hello.txt'. Conventionally files of a particular type have the same `suffix' or `extension', which is the bit at the end back to the dot. For instance the suffix .txt conventionally contains text. Filenames usually contain the normal letters (usually mostly lower case), numbers, and the symbols `.', `_' and `-'.
In Unix the layout of directories is largely historical and conventional. Fig. 1 contains a diagram how the important directories in the tree are arranged. At the IoA, many other directories exist in the tree, including the data disks and where local packages are installed. It's important to note that the directories can exist on different disks, and even on other machines on the network. Your home directory is likely to be on a different computer to the one you are using. The Network File System (NFS) allows you to access your files on different computers.
Names of files are built up from the current working directory, or from root if an absolute name is given (starting with /). Directories are specified with slashes after them.
The important one you need to remember is your home directory. It will
be at `/home/username', and it's the one you get when you log in.
The `cd' command lets you change the directory you're currently
working in, and pwd tells you where you are. Often you can refer to
your home directory quickly as `
/' or someone else's home
directory as `
username/'.
Each file and directory has permissions saying whether the owner, group or any other users are allowed to read from, write to, or run the file (r, w and x permissions). Root can always do things to a file. `ls -l' lets you examine the ownership and permissions of a file, and chmod lets you modify the permissions if you own it.
When you start a process it starts in the `foreground', letting you type input into it and letting you see what its output is. Processes may also be started in the background, letting you carry on using the terminal (where you are typing into the shell).
X is clever because it doesn't matter where the client application is running. You can run a program in Australia and have it appear on your screen, as if it were running on your local computer (with a bit of slowness).
The program which controls where the windows on your screen appear, and how they can be altered in shap and position, is the window manager. There are several window managers, the most common one here being `fvwm'.
The way a program knows which X server to talk to (i.e. where to put its window) is to look at the DISPLAY environment variable. You can see what this is set to by typing printenv DISPLAY. :0 is the screen on the computer you are using. If it says `cassXX.ast.cam.ac.uk:0', then this is a server on a completely different computer. You can change DISPLAY to point to anywhere, but it won't necessarily work unless you set up security first. It would be dangerous if you could start programs on any computer at will.
If you ssh to another computer, then ssh normally automatically sets DISPLAY for you, so windows appear on your screen. It forwards X commands over the network, securely encrypting them.
This document was generated using the LaTeX2HTML translator Version 2008 (1.71)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Ross Moore,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html -split 0 -font_size 10pt -no_navigation unix_basic.tex
The translation was initiated by Jeremy Sanders on 2011-10-02