Managing Directories Flashcards
In Linux, the command for making new directory is….?
the mkdir (make directory) command.
mkdir [OPTIONS] {DIRECTORY…}
Creates the DIRECTORY(ies), if they do not already exist. Fails with an error message if one or more of the DIRECTORY(ies) do exist, but remaining new directories are still created.
By default mkdir will not create a subdirectory if…?
the parent directory does not already exist.
mkdir -p (as in ‘parent’) can create…?
an entire directory tree at once.
by default, the ls command will only show the contents of…?
the top level directory.
if you would like the ls command to list subdirectories as well, you can add the…?
-R command line switch.
(Whenever a command iterates through a structure, operating on each element of the structure in the same manner as it operated on the topmost element, the command is said to act recursively. The -R command line switch specifies that the ls command should list with recursion.)
the ls -R can be combined with any of the previously learned command line switches, as well as, such as…?
ls -sR to include file sizes, or ls -IR to include file attributes.
the command for removing a directory is…?
rmdir (remove directory)
rmdir [OPTIONS] {DIRECTORY…}
Removes the DIRECTORY(ies), if they are empty. Fails with an error message if one or more of the DIRECTORY(ies) are not empty, but remaining (empty) directories are still removed. Note that a directory containing only a subdirectory is not empty.
Commands such as _____ and _____ succeed silently.
mkdir and rmdir
a directory tree can be copied with a single instruction…?
cp -r website archive.
a directory tree can be removed with …?
rm -r website/media
the tree command will….?
recursively list the contents of the directory, much like the ls -R command. The output, however, is displayed more intuitively as an ASCII tree.
tree -d just shows…?
directories.