Let's see. We can discuss the nature of Unix filesystems. This is sort of a condensed discussion, feel free to ask questions. I assume you are familiar with the directory tree structure of filesystems that both Unix and DOS/Windows share. A directory has subdirectories, and subdirectories can have other subdirectories, and any of those directories can have files. In DOS and Windows, every disk has its own root directory, and each disk is identified with a drive letter, C:, A:, etc. Unix is not like this. On any Unix system, there is only one root directory. Other disks are added into the filesystem as subdirectories. The root directory of a disk is "mounted" as a subdirectory of another disk. You can use the "df" command (display filesystems) to see how several disks (or disk partitions) are connected into the overall filesystem. fury.coreth.com:/home/mpearce 829> df Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/ad0s1a 128990 34494 84178 29% / /dev/ad0s1g 4562302 2431421 1765897 58% /home /dev/ad0s1e 2064302 1226074 673084 65% /usr /dev/ad0s1f 516062 8158 466620 2% /var procfs 4 4 0 100% /proc /dev/acd0c 650312 650312 0 100% /cdrom This command shows several columns. The first column is the "device" node associated with the disk or disk partition that has been mounted. The last column is its "mount point", the directory it has been connected at. The root filesystem is on /dev/ad0s1a, which the system knows is the first partition on the first slice of the first IDE hard disk drive. If I change to the root directory ("cd /"), I will be in a directory located on that partition. I have a CD-ROM mounted in the /cdrom directory. If I change to the /cdrom directory, I will be looking at files in the root directory of the CD-ROM. Unlike DOS and Windows, a filesystem must be mounted before it can be used, and dismounted before it can be removed. Part of the shutdown procedure is to dismount all the filesystems. Filesystems are mounted with the "mount" command, and dismounted with the "umount" (not "unmount") command. The long way around mounting a CD-ROM, for example is: mount -t cd9660 /dev/acd0c /cdrom This mounts the filesystem located in the CD-ROM drive (/dev/acd0c) into the /cdrom directory. The "-t cd9660" tells the mount command what type of filesystem it is (ISO 9660 is the normal format for CD-ROM's). Strictly speaking, a directory is a list of names and inode numbers. The inode number refers to a table on the disk containing information about a file, including the type of file, the file's date, permissions, location on the disk, etc. In Unix, it is possible to have more than one name reference the same inode number (and therefore the same file). It can be two different names in the same directory, or names in two different directories. This is called a "link" (that term predates HTML or the web). There are something like seven types of files (let me see if I can remember them). There are regular files. There are directories (a directory is really a file containing names and inode numbers). There are device nodes (which can be character devices or block devices), FIFOs or named pipes, there are Unix domain sockets, and there are symbolic links. In Unix, most devices have "filenames", and this filename is the device node. Take the CD-ROM drive for an example. There is a device driver in the system for IDE (ATAPI) CD-ROM drives. This driver knows how to control multiple CD-ROM drives. If a program wants to "open" or use the device driver to control the hardware device, it needs to know its name. A device node is basically a cross reference between a name that can be used by a program, and the device driver in the kernel. Device nodes are created with the "mknod" command. You need to supply the type of device (block or character), the major and minor device numbers, and the name you want to create. Most device nodes are created for you when the operating system is installed. Knowing the necessary information to create a device node that isn't there tends to be a challenging task. A FIFO and a named pipe are the same thing. A Unix domain socket is very similar to a named pipe, except that it uses the same API as the TCP/IP network socket library. These are all used for inter-process communication. Data sent into a pipe by one program or process can be read from the pipe by another program or process. A symbolic link is much like the link described above, but it is implemented differently. It is a small file referencing the real filename of some file. It can be used in circumstances that normal ("hard") links cannot be used. For instance, a hard link cannot be used with directory names. A hard link also cannot be used to create names for a file on two different filesystems. A symbolic link is slower and uses more resources, but it is usually more flexible. Links (both hard and symbolic) are created with the "ln" command. Symbolic links are often refered to as "symlinks". All files (directories, device nodes, etc) have permissions, including an owner and a group. Every file is owned by some person. It is also owned by some group. There are file permission bits that indicate what the owner, the group, and everyone else can do to the file. This information can be seen with the "ls -l" command: fury.coreth.com:/home/mpearce 836> ls -l 1874.jpg -rw-r--r-- 1 mpearce staff 22031 Aug 5 12:07 1874.jpg This file is owned by mpearce and the group staff. The first column shows permission bits. There are ten positions. The first position shows the file type: '-' for a regular file, 'd' for a directory, etc. The next three positions show the read, write, and execute permissions for the owner of the file. An 'r' indicates that the owner can read the file. A 'w' means that the owner can write to (modify) the file. An 'x' means that the owner can execute the file as if it were a program. After the three owner permission bits are three bits for the group. They have a similar meaning, and apply to any user in the staff group. The last three positions are bits indicating the permissions given to every elese on the system. If a user is not mpearce and not a member of the staff group, then it is these last three bits that dictate what that user can do the file. In the file above, anyone can read the file (it is often said to be "world readable"), but only mpearce can modify the file. File permissions are set with the "chmod" command. Also, the owner or group can be set with the "chown" and "chgrp" commands respectively. Obviously, only the owner of the file (and superuser) can set the permissions of the file. You will often see Unix people refer to file permissions in octal, a base eight numbering system with digits 0 through 7. I'm not really going to go into that right now. Some people seem to think it is easier to use the octal numbers rather than the symbolic representation of the file permissions. I'm not sure why this is, unless they like to memorize a set of common file permissions. In the example above, -rw-r--r-- is the octal number 644. A lot of this is discussed more on the chmod manpage. That ought to be enough to chew on. Please let me know which parts don't make sense. Your reading assignment: man df man mount man umount man mknod man ln man ls man chmod man chown man chgrp