Shell Scripting Question:
Download Questions PDF

How do you test for file properties in shell scripts?

Answer:

-s filename tells you if the file is not empty, -f filename tells you whether the argument is a file, and not a directory, -d filename tests if the argument is a directory, and not a file, -w filename tests for writeability, -r filename tests for readability, -x filename tests for executability

Download Shell Scripting Interview Questions And Answers PDF

Previous QuestionNext Question
How do you do number comparison in shell scripts?How do you do Boolean logic operators in shell scripting?