|< Day Day Up >|
Linux has a hierarchical, or treelike, file structure that makes it possible to organize files so that you can find them quickly and easily. This file structure contains directory files and ordinary files. Directories contain other files, including other directories; ordinary files generally contain text, programs, or images. The ancestor of all files is the root directory named /.
This chapter introduced many important system files and directories, explaining what each does. The section on file types explained the difference between ordinary and directory files and the inodes that hold each. It also covered the use of hard and symbolic links.
Most Linux filesystems support 255-character filenames. Nonetheless, it is a good idea to keep filenames simple and intuitive. Filename extensions can help make filenames more meaningful.
An absolute pathname starts with the root directory and contains all the filenames that trace a path to a given file. Such a pathname starts with a slash representing the root directory and contains additional slashes between the other filenames in the path.
A relative pathname is similar to an absolute pathname but starts the path tracing from the working directory. A simple filename is the last element of a pathname and is a form of a relative pathname.
When you are logged in, you are always associated with a working directory. Your home directory is your working directory from the time you first log in until you use cd to change directories.
A Linux filesystem contains many important directories, including /usr/bin, which stores most of the Linux utility commands, and /dev, which stores device files, many of which represent physical pieces of hardware. An important standard file is /etc/passwd; it contains information about users, such as the user ID and full name.
Among the attributes associated with each file are access permissions. They determine who can access the file and the manner in which the file may be accessed. Three groups of user(s) can access the file: the owner, members of a group, and all other users. A regular file can be accessed in three ways: read, write, and execute. The ls utility with the l option displays these permissions. For directories, execute access is redefined to mean that the directory can be searched.
The owner of a file or Superuser can use the chmod utility to change the access permissions of a file. This utility defines read, write, and execute permissions for the file's owner, the group, and all other users on the system.
A link is a pointer to a file. You can create several links to a single file so that you can share the file with other users or have the file appear in more than one directory. Because only one copy of a file with multiple links exists, changing the file through any one link causes the changes to appear in all the links. Hard links cannot link directories or span filesystems, whereas symbolic links can.
Table 4-2 lists the utilities introduced in this chapter.
|< Day Day Up >|