A user accidentally created the subdirectory \dir in his home directory. Which of the following commands will remove that directory?
A. rmdir ~/’dir’
B. rmdir ~/\dir
C. rmdir ‘~/\dir’
D. rmdir “~/\dir”
E. rmdir ~/\\dir
Explanation:
11 Comments on “Which of the following commands will remove that directory?”
Gonzosays:
Incorrect – answer is B.
0
1
osoriohenriquesays:
Actually \ is a special character, so you need to use another \ to say to your terminal that it needs to read the command literally. The answer is correct.
1
0
Dknssays:
I tested it the answer is B
0
1
director47says:
The answer is E. try to create a directory labeled “\dir”
mkdir ~/\\dir would create that.
mkdir ~/\dir would create dir
test it by doing the following. Make sure you are in your home.
cd ~
mkdir ~/\\dir
ls -l
# the output will show \dir as the name of the directory.
#now try removing it using the wrong answers and then the correct one. you will see that E is correct.
rmdir ~/\\dir
ls -l
5
0
Ken Masterssays:
The answer is E. As explained the “\” is a special character and needs to be “escaped”. Do that by adding another “\” which is the escape character. This will negate the \ in the directory name.
0
0
Mikesays:
E
0
0
Busindresays:
E is 100% correct and B is wrong
B)
rmdir ~/\dir
rmdir: failed to remove ‘/home/XXXX/dir’: No such file or directory
E)
rmdir ~/\\dir
0
0
Syrsays:
zone@zone:~$ rmdir ~/\\dir
rmdir: failed to remove ‘/home/uone/\dir’: No such file or directory
and
rmdir ~/\dir works and no error, anyone cares explain?
0
0
Busindresays:
You have created the directory incorrectly.
mkdir “\dir”
0
0
Vongosays:
dannnng that is what is up Carlo! You the real MVP!
0
0
Brett Goldsteinsays:
BTW, you can get part of free premium LX0-103 dumps here:
Incorrect – answer is B.
0
1
Actually \ is a special character, so you need to use another \ to say to your terminal that it needs to read the command literally. The answer is correct.
1
0
I tested it the answer is B
0
1
The answer is E. try to create a directory labeled “\dir”
mkdir ~/\\dir would create that.
mkdir ~/\dir would create dir
test it by doing the following. Make sure you are in your home.
cd ~
mkdir ~/\\dir
ls -l
# the output will show \dir as the name of the directory.
#now try removing it using the wrong answers and then the correct one. you will see that E is correct.
rmdir ~/\\dir
ls -l
5
0
The answer is E. As explained the “\” is a special character and needs to be “escaped”. Do that by adding another “\” which is the escape character. This will negate the \ in the directory name.
0
0
E
0
0
E is 100% correct and B is wrong
B)
rmdir ~/\dir
rmdir: failed to remove ‘/home/XXXX/dir’: No such file or directory
E)
rmdir ~/\\dir
0
0
zone@zone:~$ rmdir ~/\\dir
rmdir: failed to remove ‘/home/uone/\dir’: No such file or directory
and
rmdir ~/\dir works and no error, anyone cares explain?
0
0
You have created the directory incorrectly.
mkdir “\dir”
0
0
dannnng that is what is up Carlo! You the real MVP!
0
0
BTW, you can get part of free premium LX0-103 dumps here:
https://drive.google.com/open?id=0B-ob6L_QjGLpTXA3M1FIWlZwWnM
0
0