Skip to content
Advertisement

Why can’t bash recognize the existence of a socket file

On a Linux box I want to check if a specific socket file exists. I know the socket files exists, but my checks in bash don’t show that to me:

JavaScript

Why oh why can’t bash see that the file exists?

Advertisement

Answer

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

Use -S to test if its a socket. -f is for regular files.

See man 1 test:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement