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
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
A good feature of Unix is that there is an on-line help to all
explains you a lot about any command.
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
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
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 "..".
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
- make a file maketree.txt from the example listed. You can do it by
invoking the editor by
- nedit maketree.txt (from a command window).
- you mark the example text by mouse
- paste it to the nedit by clicking on the middle
- alternatively you can call maketree.txt by clicking
here and using Mosaic's
ability save as as makefile.txt
- You can run the script by
- You can Do it another way. But first, look at the directory Tree by a command
- Play with the Tree, trying