1.

____ option is used with a test for checking if the file exists and has the size greater than zero.(a) -f(b) -r(c) -e(d) -sThe question was asked during an interview.I'd like to ask this question from Shell Programming using Various Commands topic in division Essential Shell Programming of Unix

Answer»

Right answer is (d) -s

Explanation: test can ALSO be used for performing VARIOUS file tests like checking whether the file is a regular file, or is it readable, WRITABLE or executable. To CHECK whether the file exists and has the size greater than zero, we have to use -s option with test. For EXAMPLE,



Discussion

No Comment Found

Related InterviewSolutions