Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

LINUX TEST FOLDER EXITS

You can use test -d (see man test).

-d file True if file exists and is a directory.

For example:

test -d "/etc" && echo Exists || echo Does not exist
 
PREVIOUS NEXT
Tagged: #LINUX #TEST #FOLDER #EXITS
ADD COMMENT
Topic
Name
6+3 =