To remove the file named my document.txt, which one of the following commands will be used?

To remove the file named my document.txt, which one of the following commands will be used?
A. rm my\ document.txt
B. rm my document.txt
C. rm *
D. rm my_document.txt
 
Answer: a
Explanation: Apart from metacharacters, there are other characters that are special like the space character. The shell uses it to delimit command line arguments. So to remove the file my document.txt we can use escaping. The backslash will make the shell to ignore the space. Hence file will be removed easily.
 

Tìm kiếm

Back
Top