3. Files
Following are some common UNIX directories and what they contain:
Important directories within UNIX |
|
/ | The root directory, everything is a subdirectory of this |
/usr | User utilities and data most of operating system |
/usr/bin | Most user programs are in this directory |
/etc | System configuration and identification information |
/export/home -or- /home | Contains home directories for user |
/tmp | Shared temporary storage area |
/var | Variable length queues and logs |
/opt | Optional programs, like third party software |
To see a file and its permissions type ls l. The output will look
like this:
drwxr-xr-x 2 root 24 Sep 11 15:27 dir.test
-rw-r--r-- 1 joe 46 Apr 15 14:36 file.test
The first character tells whether this listing is a directory (the d in the first one means directory, the other possible letters are: l = link, - = file, p = named pipes, c = character and block special devices, b = block special device, and the next 9 indicate the permissions. The first 3 are permissions for the user (or owner) of the file (r=read, w=write, x=execute), the second three are for the group, and the third is for others, so in the first listing the owner (root) has read, write and execute privilege, while the group and others have only read and execute. The next entries are subdirectories, name of owner, file size date made, time made, and then the file name. In the directory part of the list there are sometimes links. (there are two kinds of links, hard and symbolic or soft). To see what type of link something is, type ls n, and to make links type ln s for soft links, and ln for hard links. A link is an entry that tells the real location of a file. A symbolic link is a link to a file, while the faster hard link is like a patch, and is good because if you make a change it will update all links. A hard link is like directly accessing the file, while a soft link is just directions to the file.
To adjust files
Go to Chapter 2
Go to Index
Go to Chapter 4