1.

How can we identify executables and directories from the output of ls command?(a) using -F option(b) using-x option(c) using -a option(d) using -i optionThis question was addressed to me in an online interview.This interesting question is from Listing Directory Contents: Is Command topic in division The File System of Unix

Answer»

The correct option is (a) USING -F option

Best explanation: The OUTPUT of the ls command simply DISPLAYS filenames without indicating the file type. For identifying the file type we USE -F option. The output of ls-F displays filenames with two symbols * and /, which are type indicators. The filenames containing * are executables while those containing / are directories.



Discussion

No Comment Found

Related InterviewSolutions