1.

Which of the following files will not be deleted using “rm chap??” ?(a) chap01(b) chap02(c) chaptd(d) chactdThis question was addressed to me in an online quiz.My query is from Pattern Matching, Escaping and Quoting topic in section The Shell of Unix

Answer» RIGHT option is (d) chactd

The explanation: Since ? is USED to match a SINGLE character, ?? can match two characters. So the above command will remove all FILES with a filename starting with a prefix ‘CHAP’, followed by any two characters.


Discussion

No Comment Found

Related InterviewSolutions