How do you check if it is a file or directory in bash?

How do you check if it is a file or directory in bash?
Answer
In order to check if a directory exists in Bash, you have to use the “-d” option and specify the directory name to be checked. As an example, let’s say that you want to check with Bash if the directory /etc exists on your system.
 

Tìm kiếm

Back
Top