Try this
Code: Select all
/proc/net/tcp
Code: Select all
(echo >/dev/tcp/localhost/22) &>/dev/null && echo "TCP port 22 open" || echo "TCP port 22 close"
Code: Select all
(echo >/proc/net/tcp/localhost/22) &>/dev/null && echo "TCP port 22 open" || echo "TCP port 22 close"
Believe I tried this when I ran a sudo find -xdev -type f -name "tcp" -print # Time I found /dev/tcp to be moved -yes- results showed /proc/net/"tcp"
Code: Select all
file tcp # result was "Empty"
ls -lat # Also shows all files in this directory are all "Zero (0) byte " in size meaning no value usage. ?
dr-xr-xr-x 6 root root 0 Jul 5 12:24 stat/
-r--r--r-- 1 root root 0 Jul 5 12:24 tcp
-r--r--r-- 1 root root 0 Jul 5 12:24 tcp6
-r--r--r-- 1 root root 0 Jul 5 12:24 udp
-r--r--r-- 1 root root 0 Jul 5 12:24 udp6
-r--r--r-- 1 root root 0 Jul 5 12:24 udplite
-r--r--r-- 1 root root 0 Jul 5 12:24 udplite6
-r--r--r-- 1 root root 0 Jul 5 12:24 unix
^^ - all column
ls -lat | awk '{print $5}' # nice column of all 0's