Part 1: Unix file system and command interpretters

Unix file system and command interpretters

When you sit at a command line terminal or computer, you are using a special program. We call it command interpreter.
On a personal computer you can see that program, it is called command.com.

On windowing system, like Macintosh or Microsoft Windows, some of the role of the command interpreter is taken by the so called GUI (Graphical User Interface). On the unix systems, there is a variety of command interpreters, usually called shell. There is a csh - C-shell, sh - Bourne shell, kcsh on our HP machines etc. To the interpreter you can issue single commands or ask it to run whole scripts contained in a script file. On MS-DOS machines, the scripts are call batch-files, they must be named filename.bat. On Unix machines they can have any name. We shall approch this subject below.

A good feature of Unix is that there is an on-line help to all system commands. The command
man commandname
explains you a lot about any command.

Try
man man
man ls
man cd

If you have enough time to wait for rather slow responses, you can read a lot about Unix at this machine in England.

File system structure

Files on a Unix system are organised in a hierarchy structure.

Root (/) contains usually the whole filesystem and especially the system files. These are in directories like /bin, /etc and /usr. Until you become more experienced Unix user, you do not need to think much about these.

Absolute path starts at the root directory and starts by "/". Relative path starts relatively from where you are and does not start by the "/".

Presnt Working Directory is the directory "where you are" and it is given to you by a command pwd. P.W.D. can be referred to by a dot ("."). This means that filename and ./filename refere mostly to the same file.

Home directory is where you come when you log in. You can refere to it by "~" (tilde). E.g. ~/fil referers to fil in the home directory. Andre brukarar sin heimekatalog vert referert til med ~brukar, der brukar er brukarnamnet. Td. refererer ~magne/fil til fila fil i brukaren magne sin heimekatalog.

Parent directory (one "above") can be referred to by "..".

Filnames

Roughly anything goes, any length, but not special characters as norwegian signs, CTRL- signs etc. Sometimes the system creates such funny names in response to your typing errors, and they are difficult to refer. You can use the dividing signs (".", "-", "_") without problems. Upper and lower case are different characters, FILE.name and file.name are two different files.

Wildcards, most used is a star (*). for example, file* refers to file1,file2, filename, etc., if they all exist.

Task: Find out what these commands do.


Task: work with scripts

The file maketree makes a little tree of directories