Workshop
The Workshop summarizes the key terms you learned and poses some questions about the topics presented in this chapter. It also provides you with a preview of what you will learn in the next hour.
Key Terms
absolute filename Any filename that begins with a leading slash (/); these always uniquely describe a single file in the file system.
binary A file format that is intended for the computer to work with directly rather than for humans to peruse. See also executable.
device driver All peripherals attached to the computer are called devices in Unix, and each has a control program always associated with it, called a device driver. Examples are the device drivers for the display, keyboard, mouse, and all hard disks.
directory A type of Unix file used to group other files. Files and directories can be placed inside other directories, to build a hierarchical system.
directory separator character On a hierarchical file system, there must be some way to specify which parts of a full filename are directories and which part is the actual filename itself. This becomes particularly true when you’re working with absolute filenames. In Unix, the directory separator character is the slash (/), so a filename like /tmp/testme is easily interpreted as a file called testme in a directory called tmp.
dot A shorthand notation for the current directory.
dot dot A shorthand notation for the directory one level higher up in the hierarchical file system from the current location.
dot file A configuration file used by one or more programs. These files are called dot files because the first letter of the filename is a dot, as in .profile or .login. Because they’re dot files, the ls command doesn’t list them by default, making them also hidden files in Unix. See also hidden file.
executable A file that has been set up so that Unix can run it as a program. This is also shorthand for a binary file. You also sometimes see the phrase binary executable, which is the same thing. See also binary.
hidden file By default, the Unix file-listing command ls shows only files whose first letter isn’t a dot (that is, those files that aren’t dot files). All dot files, therefore, are hidden files, and you can safely ignore them without any problems. Later, you learn how to view these hidden files. See also dot file.
home directory This is your private directory and is also where you start out when you log in to the system.
kernel The underlying core of the Unix operating system itself. This is akin to the concrete foundation under a modern skyscraper.
preference file These are what dot files (hidden files) really are: They contain your individual preferences for many of the Unix commands you use.
relative filename Any filename that does not begin with a slash (/) is a filename whose exact meaning depends on where you are in the file system. For example, the file test might exist in both your home directory and in the root directory: /test is an absolute filename and leaves no question which version is being used, but test could refer to either copy, depending on your current directory.
root directory The directory at the very top of the file system hierarchy, also known as slash.
search path A list of directories used to find a command. When a user enters a command ls, the shell looks in each directory in the search path to find a file ls, either until it is found or the list is exhausted.
slash The root directory.
symbolic link A file that contains a pointer to another file rather than contents of its own. This can also be a directory that points to another directory rather than having files of its own. A useful way to have multiple names for a single program or to allow multiple people to share a single copy of a file.
user environment A set of values that describe the user’s current location and modify the behavior of commands.
working directory The directory where the user is working.
Exercises
- Can you think of information you work with daily that’s organized in a hierarchical fashion? Is a public library organized hierarchically?
Which of the following files are hidden files and directories according to Unix?
.test hide-me ,test .cshrc ../ .dot. dot .HiMom
What programs most likely created the following dot files and dot directories?
.cshrc .rnsoft .exrc .print .tmp334 .excel/ .letter .vi-expert
In the following list, identify the items that are absolute filenames:
/Personnel/Taylor,D. /home/taylor/business/California ../.. Recipe:Gazpacho
- Referring to the list of directories found on all Unix systems (/bin, /dev, /etc, /lib, /lost+found, /mnt, /sys, /tmp, /usr), use cd and pwd to double-check that they are all present on your own Unix machine.
Preview of the Next Hour
In the next hour, you learn all about the ls command that you’ve been using, including an extensive discussion of command flags. The command touch enables you to create your own files, and du and df help you learn how much disk space is used and how much is available, respectively. You also learn how to use a valuable if somewhat esoteric Unix command, compress, which helps you minimize your disk-space usage.