If the working directory is /home/max with a subdirectory named literature, give three sets of commands you can use to create a subdirectory named classics under literature. Also give several sets of commands you can use to remove the classics directory and its contents.
What will be an ideal response?
The first command line uses a relative pathname while the second and third
use absolute pathname to create the classics directory under the literature
directory. Both commands are executed from Max’s home directory
(although it does not matter where you execute the second command from):
$ mkdir literature/classics
$ mkdir /home/max/literature/classics
$ mkdir ~/max/literature/classics
Next a cd command changes the working directory to literature. From
literature, a simple pathname or an absolute pathname can create the clas-
sics directory:
$ cd literature
$ mkdir classics
$ mkdir /home/max/literature/classics
Before you remove a file, use pwd to check that the working directory is
what you think it is and, if you plan to use an ambiguous file reference, use
that file reference to list the files you will delete. This procedure helps ensure
you do not delete files by mistake. Next rm removes ordinary files, and rmdir
removes the empty (except for the two standard directory entries . and ..)
directory file:
$ pwd
/home/max
$ ls literature/classics/*
...
$ rm literature/classics/*
$ rmdir literature/classics
You can also perform this task either of these ways:
$ cd literature
$ ls classics
...
$ rm classics/*
$ rmdir classics
$ cd classics
$ ls
...
$ rm *
$ cd ..
$ rmdir classics
You might also like to view...
What happens if a function throws an exception of a type not allowed by the exception specification for the function?
What will be an ideal response?
How does a bar code reader work?
What will be an ideal response?
A(n) ____________________ is a defined grouping of individual phone circuits served by a single multiplexer.
Fill in the blank(s) with the appropriate word(s).
To delete data from the database, use the ____ command.
A. ROLLBACK B. COMMIT C. DELETE D. UPDATE