noaa NOAA / NESDIS / National Geophysical Data Center / WDC for SEG, Boulder, Colorado USA noaa
banner
next  up  previous
Next: Redirecting Input and Output Up: Getting Started Previous: Survival Unix

The UNIX file system

Fundamental to the UNIX operating system is the concept of directories and files. On windows based operating systems, directories are depicted as ``folders'' and moving about is accomplished by clicking on the different icons. In UNIX, the directories have names and are arranged in a hierarchical sequence with the top directory being the ``root'' directory, known as ``/'' (see Figure A.1. Within the ``/'' directory, there are subdirectories (e.g. usr and home). In any directory, there can also be ``files'' (e.g. ex1.1, ex1.2) in the figure. Files can be ``readable'', ``writable'' and/or ``executable''.
2#2

When you log in, you enter the computer in your ``home'' directory. To refer to directories, UNIX relies on what is called a ``pathname''. Every object has an ``absolute'' pathname which is valid from anywhere on the computer. The absolute pathname always begins from the root directory /. So the absolute pathname to the home directory lisa in Figure A.1 is /home/lisa. Similarly, the absolute pathname to the directory containing pmag1.0 executables is /usr/local/pmag1.0/bin. There is also a ``relative'' pathname, which is in reference to the current directory. If user ``lisa'' is sitting in her home directory, the relative pathname for the file notes in the directory bookstuff would be bookstuff/notes. When using relative pathnames, it is useful to remember that ./ refers to the current directory and ../. refers to the one above.

Commands typed at the command line prompt are handled by a program called the ``shell''. There are many different sorts of shells (e.g. sh, csh, jsh, ksh, bash, tsh) that have a different look and feel but they all perform the task of interpreting between the user and the ``kernal'' which is the actual UNIX operating system. In order to execute a command, the shell needs to know where the command is. There are several ``built-in'' commands, but most are programs that are either part of the operating system, or something someone wrote (like the ones referred to here). There are any number of places where programs are kept, so the shell looks in particular places determined by your ``path'' environment variable. To instruct the shell to look in directories other than the default directories (for example in /usr/local/pmag1.0/bin), ask your system administrator to add this directory to your ``path''. Otherwise, you can always type the absolute pathname for any program (e.g. /usr/local/pmag1.0/bin/fishrot to execute fishrot.

UNIX filesystem
Figure A.1:  UNIX filesystem.


For content questions please contact: Lisa Tauxe

Scripps Institution of Oceanography
La Jolla, CA 92093-0220, USA
Phone: (+1.619) 534-6084
Fax: (+1.619) 534-0784
NOAA>NESDIS>NCEI>Geomagnetism