1.

The output of ls dir* is ___(a) all files in the current directory(b) all files in the directory having a filename starting with dir(c) no filename is displayed(d) erroneousI had been asked this question in an internship interview.My question is from Listing Directory Contents: Is Command in chapter The File System of Unix

Answer»

Right option is (b) all FILES in the DIRECTORY having a filename starting with dir

For EXPLANATION I would say: The above COMMAND displays those files in the directory, the NAMES of which will be starting with a prefix ‘dir’. Here * is a meta-character which is used for pattern matching.



Discussion

No Comment Found

Related InterviewSolutions