Specifically, we will learn how to move around the file system, create, modify and delete files and directories and understand how permissions work.
What exactly is a file system? Well, perhaps the first question we should ask is what is a file.
By now, most of us will be familiar with the concept of files. In fact, we use them every day. We save them, delete them, copy them, move them, etc. It is almost as if files were real things on our computer.
Well in actuality a file is only an abstract concept (a data structure). It is a metaphor used to describe a theoretical grouping of dispersed bits within a computer's memory.
In actuality, files do not exist
From the perspective of the computer, there are only flittering, ethereal bits floating around in its memory. True, these bits do have references to each other, but there is no actual "file thingy" sitting in the computer somewhere.
A file is actually a pretend creature that we have imagined to help us deal with what is otherwise a very ethereal thing.
Of course, never underestimate the power of make believe. It is extremely useful to use the file metaphor because it helps people do work. The file metaphor helps us organize things and feel comfortable in the worldless world of bits and bytes.
|Files within the UNIX
file system can be identified by their path and name. As such,
filename standards and conventions have developed to make browsing the
file system more efficient. Some of the standards you should be familiar
with are listed below:
And so another crucial task performed by the operating system is the provision of a file system to fully elaborate the file metaphor.
A file system is also an abstract data structure used to store information. However, a file system stores information about files (a metaphor to hold metaphors).
Typically, the file system uses the file cabinet metaphor to describe how files are stored within the bowels of the computer. Individual files are grouped into file folders called directories. Directories may contain files or sub-directories. Sub-directories can contain more files or more sub-directories and so on, and so on.
Like most modern operating systems, UNIX defines an inverted tree file system emanating from a single "root" directory. This is shown below
The structure of the UNIX file system however, has some general rules that you can use to navigate through it. Specifically, it defines a set of generic directories that hold a predictable set of files. Each system administrator may add to or delete from these standard directories, but it is a good bet that you will see the following hierarchy on freshly installed UNIX systems.
Lets take a look at a few of the more important ones from the perspective of a web technician.
The "bin" Directory
This directory contains binary files and executables that are considered basic to the use of the system. We are going to discuss many of these commands tomorrow such as "ls", "mv", or "grep". For the most part, you do not need to access this directory yourself. However, it is a good idea that you know where it is located.
Since these executables are considered basic, generally, all users are granted permission to read or execute the files in "bin". We will talk more about permissions later.
The "lib" Directory
This directory contains libraries for any installed compilers. If you are writing CGI scripts in C, you may be interested in making sure the libraries you need can be found here.
The "tmp" Directory
This directory is used to store temporary files created by users or applications. You are free to use this directory, but make sure you do not store anything that cannot be deleted since this directory is often wiped out when the system is rebooted.
The "usr" Directory
The usr directory is where you will probably spend most of your time. The usr directory contains files relevant to users whereas the rest of the directories we have discussed are more oriented towards systems issues.
For example, if you are working with an HTTPD web server, you are likely to find it in "/usr/local/etc/httpd". Similarly, most home pages will be based in the "/usr/home" directory. Finally, supporting applications such as the perl interpreter will be found in "/usr/bin".
Hold on, what does "/usr/local/etc/httpd" mean? Well, "/usr/local/etc/httpd" is called a "path" and is essentially the address of some file or directory. Let's take a closer look at paths.