coreutils: File type tests
16.3.1 File type tests
----------------------
These options test for particular types of files. (Everything’s a file,
but not all files are the same!)
‘-b FILE’
True if FILE exists and is a block special device.
‘-c FILE’
True if FILE exists and is a character special device.
‘-d FILE’
True if FILE exists and is a directory.
‘-f FILE’
True if FILE exists and is a regular file.
‘-h FILE’
‘-L FILE’
True if FILE exists and is a symbolic link. Unlike all other
file-related tests, this test does not dereference FILE if it is a
symbolic link.
‘-p FILE’
True if FILE exists and is a named pipe.
‘-S FILE’
True if FILE exists and is a socket.
‘-t FD’
True if FD is a file descriptor that is associated with a terminal.