1.

Which option is used for checking if the file exists or not?(a) -e(b) -a(c) -n(d) -fThe question was posed to me in an interview for job.The question is from Using test and [ ] to Evaluate Expressions topic in portion Essential Shell Programming of Unix

Answer»

Right option is (a) -e

Best explanation: test can ALSO be used to test the various file ATTRIBUTES like its type (ordinary, regular or symbolic LINK). To CHECK whether the file EXISTS or not, we can use the -e option. For example,



Discussion

No Comment Found

Related InterviewSolutions