Chapter summary

 < 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.

Table 4-2. Utilities introduced in Chapter 4


Associates you with another working directory (page 82)


Changes the access permissions on a file (page 92)


Makes a link to an existing file (page 97)


Creates a directory (page 80)


Displays the pathname of the working directory (page 81)


Deletes a directory (page 88)

     < Day Day Up > 

    A Practical Guide to LinuxR Commands, Editors, and Shell Programming
    A Practical Guide to LinuxR Commands, Editors, and Shell Programming
    ISBN: 131478230
    EAN: N/A
    Year: 2005
    Pages: 213 © 2008-2017.
    If you may any questions please contact us: