1.

Which command is used for removing file named-file.txt?(a) rm -file.txt(b) rm file.txtrm(c) rm — -file.txt(d) rm -f file.txtI had been asked this question in an interview.I need to ask this question from Deleting and Renaming files: rm and mv Command topic in portion Handling Ordinary Files of Unix

Answer»

Correct ANSWER is (C) rm — -file.txt

Easy explanation: To delete a file with filename BEGINNING with a ” – “, we have to use ( — ) i.e. double-dash. ” — ”is USED so that rm command does not misinterpret the filename as an OPTION.



Discussion

No Comment Found

Related InterviewSolutions