101-500 Exam QuestionsBrowse all questions from this exam

101-500 Exam - Question 100


A user accidentally created the subdirectory \dir in his home directory. Which of the following commands will remote that directory?

Show Answer
Correct Answer: D

Discussion

17 comments
Sign in to comment
MurteiraOption: A
May 16, 2021

People pointing answers C and D are not creating the directory with the leading \. To do that you need do use mkdir "\dir" since mkdir \dir will create a directory named only "dir". Thats why C and D are working for them. Correct answer is A.

CuriousLinuxCat
Jul 24, 2021

Fully agree that it is A.

iwkno6
Jul 28, 2021

Exactly!

pablex_wolf
Jun 7, 2020

There is a typo, they mean "remove"

nedoexOption: A
Jan 22, 2022

\ for escaping

LazylinuxOption: A
Apr 7, 2022

Tested it is A

TT924Option: A
Dec 4, 2022

A , /\ to display special character \

Avanade2023Option: A
Aug 17, 2021

I tested on "CentOS Linux release 8.2.2004 (Core)", The answer is A(rmdir ~/\\dir). Others' results are same as "No such file or directory". but, if you run "rmdir ~/'\dir'", it will be removed successfully.

dspaulaOption: A
Nov 4, 2021

Correct answer is A. Tested on Centos 7

Roger95Option: A
Nov 18, 2021

basically, you can create \dir directory in homedir using 'mkdir ~/\\dir' That's why answer is A that using the same way to remove it. Note: backslash "\" used to remove special meaning on the following character, Example: \x will display x as string even though x has a special meaning.

anhcqOption: A
Nov 26, 2021

the name \dir contain character \ which needs to be escaped by \

serlanOption: A
Dec 21, 2021

Correct answer is A.

KiddyLittyOption: C
Apr 14, 2022

Answer A didn't work for me. Double backslash is not working on CentOS7 minimal with or without quotes. Agree with "C"

KiddyLitty
Apr 14, 2022

Sorry it is "D", not C

gonzalocoOption: A
Apr 19, 2022

A is correct

meer01Option: A
Nov 1, 2022

A is correct

blk_542Option: A
Nov 20, 2022

A: seen as correct in another guide and tested in my home directory as regular user, cemtos 7, not root: mkdir "\dir" ls -l \dir then tried the different deleting options and the only working was A, no need to use any quotation marks.

Jack67Option: A
May 10, 2023

A is correct, I tested

sblancocr
Sep 19, 2023

I think rhat C and D... on this cases... works the remove directory $ mkdir dir $ ls dir $ ls d* dexample.gz.tar dir: rmdir ~/\dir $ ls d* dexample.gz.tar $ mkdir dir sblanco@idp:~$ rmdir ~/'dir' sblanco@idp:~$ ls d* dexample.gz.tar $ mkdir dir $ rmdir ~/'dir' $ ls d* dexample.gz.tar

peppinielloOption: A
Nov 4, 2023

folder = \dir