Question 30Asked in UGC NET Computer Science, December 2015 (Paper II & III, Selected Questions)

What will be the output of the following Unix command? $rm chap0\[1 – 3\]

What will be the output of the following Unix command? $rm chap0\[1 – 3\]
  1. ARemove file chap0[1 – 3]
  2. BRemove file chap01, chap02, chap03
  3. CRemove file chap\[1 – 3\]
  4. DNone of the above
Show answerHide answer

Correct answer: (A) Remove file chap0[1 – 3]

Explanation

rm chap* would remove all files beginning with chap. To remove a file whose name contains a special character, escape it with the backslash (\); this is called escaping or despecializing. So rm chap0\[1 – 3\] removes the file named chap0[1 – 3] itself.

From UGC NET Computer Science PYQ, December 2015 (Paper II & III, Selected Questions)

This is question 30 of UGC NET Computer Science PYQ, December 2015 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.