< Day Day Up > |
This section covers deleting directories, copying and moving files between directories, and moving directories. It also describes how to use pathnames to make your work with Linux easier. rmdir: Deletes a directoryThe rmdir (remove directory) utility deletes a directory. You cannot delete the working directory or a directory that contains files other than . and . . entries. If you need to delete a directory with files in it, first use rm to delete the files and then delete the directory. You do not have to (nor can you) delete the . and . . entries; rmdir removes them automatically. The following command deletes the directory that was created in Figure 4-5 on page 81: $ rmdir /home/alex/literature The rm utility has a r option (rm r filename) that recursively deletes files, including directories, within a directory as well as the directory itself. caution: Use rm r carefully, if at all Although rm r is a handy command, you must use it carefully. Do not use it with an ambiguous file reference such as *. It is quite easy to wipe out your entire home directory with a single short command. Pathnames |
< Day Day Up > |