Managing Directories Flashcards

1
Q

In Linux, the command for making new directory is….?

A

the mkdir (make directory) command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

mkdir [OPTIONS] {DIRECTORY…}

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

By default mkdir will not create a subdirectory if…?

A

the parent directory does not already exist.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

mkdir -p (as in ‘parent’) can create…?

A

an entire directory tree at once.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

by default, the ls command will only show the contents of…?

A

the top level directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

if you would like the ls command to list subdirectories as well, you can add the…?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

the ls -R can be combined with any of the previously learned command line switches, as well as, such as…?

A

ls -sR to include file sizes, or ls -IR to include file attributes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

the command for removing a directory is…?

A

rmdir (remove directory)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

rmdir [OPTIONS] {DIRECTORY…}

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Commands such as _____ and _____ succeed silently.

A

mkdir and rmdir

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

a directory tree can be copied with a single instruction…?

A

cp -r website archive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

a directory tree can be removed with …?

A

rm -r website/media

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

the tree command will….?

A

recursively list the contents of the directory, much like the ls -R command. The output, however, is displayed more intuitively as an ASCII tree.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

tree -d just shows…?

A

directories.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly