Shell Scripting Question:

How do you test for file properties in shell scripts?

Tweet Share WhatsApp

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 PDF Read All 30 Shell Scripting Questions
Previous QuestionNext Question
How do you do number comparison in shell scripts?How do you do Boolean logic operators in shell scripting?