为什么bash不能识别套接字文件的存在

kra*_*r65 9 sockets linux bash file

在Linux机器上,我想检查是否存在特定的套接字文件.我知道套接字文件存在,但我在bash中的检查没有向我显示:

$ ls -l /var/run/supervisor.sock
srwxrw-rw- 1 root root 0 Jun  3 13:30 /var/run/supervisor.sock  # <== THE FILE EXISTS!!
$ if [ ! -f /var/run/supervisor.sock ]; then echo 'file does not exist!'; fi
file does not exist!
Run Code Online (Sandbox Code Playgroud)

为什么哦为什么不能bash看到该文件存在?

bod*_*gly 26

http://www.tldp.org/LDP/abs/html/fto.html

使用-S如果测试插座.-f适用于常规文件.

man 1 test:

   -e FILE
          FILE exists
   -f FILE
          FILE exists and is a regular file
   ...
   ...
   -S FILE
          FILE exists and is a socket
Run Code Online (Sandbox Code Playgroud)