A user accidentally created the subdirectory \dir in his home directory. Which of the following commands will remote that directory?
A user accidentally created the subdirectory \dir in his home directory. Which of the following commands will remote that directory?
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.
Fully agree that it is A.
Exactly!
There is a typo, they mean "remove"
\ for escaping
Tested it is A
A , /\ to display special character \
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.
Correct answer is A. Tested on Centos 7
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.
the name \dir contain character \ which needs to be escaped by \
Correct answer is A.
Answer A didn't work for me. Double backslash is not working on CentOS7 minimal with or without quotes. Agree with "C"
Sorry it is "D", not C
A is correct
A is correct
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.
A is correct, I tested
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
folder = \dir