2.4 Finding Your Way - Creating, Moving, and Deleting Files Flashcards

1
Q

Which of the following commands will create a new directory called Test in the /tmp folder?

A) mkdir /tmp/Test
B) newdir
C) dir /tmp/Test
D) mkdir ./tmp/Test

A

mkdir /tmp/Test

mkdir /tmp/Test will create a new directory called Test in the /tmp folder.

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

Which of the following commands will delete the Test directory in the folder above the current working directory?

A) rm -r ../../Test
B) rm -r */Test
C) rm -r /Test
D) rm -r ../Test

A

rm -r ../Test

rm -r ../Test will delete the Test directory in the folder above the current working directory.

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

Which of the following commands will move all files in the current directory that start with file_ to /tmp?

A) mv file_. /tmp
B) mv file_? /tmp
C) mv file_ /tmp
D) mv file_* /tmp

A

mv file_* /tmp

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

What command will copy the directory testdir_1 to testdir_2?

A

cp -r testdir_1 testdir_2

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

What command will remove the directory testdir_1?

A

rm -r testdir_1

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

What command will copy the file testfile_1 to testfile_2?

A

cp testfile_1 testfile_2

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

What command will remove the file testfile_1?

A

rm testfile_1

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

What wildcard will match any single character?

A

?

ex: ls ????4 will return the output of any file that is 4 characters long and that ends in the number 4.

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

What wildcard will match any number character(s)?

A

Asterik symbol
ex: ls *4 will return the output of any number of characters long ending in the number 4.

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