Which option to check if the file exists and is executable?

Ivanesn

New member
Which option to check if the file exists and is executable?
Answer
While checking if a file exists, the most commonly used file operators are
-e and -f.The ‘-e’ option is used to check whether a file exists regardless of the type, while the ‘-f’ option is used to return true value only if the file is a regular file (not a directory or a device).
 

Tìm kiếm

Back
Top