File system tests check file types and ownership. They are similar
to options to test shell command:
-b filefile exists and is block special
-c filefile exists and is character special
-d filefile exists and is a directory
-e filefile exists
-f filefile exists and is a regular file
-g filefile exists and is set-group-ID
-G filefile exists and is owned by the primary group of the current user.
-h file-L filefile exists and is a symbolic link
-k filefile exists and has its sticky bit set
-L filefile exists and is a symbolic link (same as -h)
-O filefile exists and is owned by the current user
-p filefile exists and is a named pipe
-r filefile exists and read permission is granted
-s filefile exists and has a size greater than zero
-S filefile exists and is a socket
-u filefile exists and its set-user-ID bit is set
-w filefile exists and write permission is granted
-x filefile exists and execute (or search) permission is granted
This document was generated on January 2, 2022 using makeinfo.
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.