Show listening TCP ports without netstat
declare -a ports=($(tail -n +2 /proc/net/tcp | cut -d":" -f"3" | cut -d" " -f"1"))
for port in ${ports[@]}; do
echo $((0x${port}))
done | sort | uniq
declare -a ports=($(tail -n +2 /proc/net/tcp | cut -d":" -f"3" | cut -d" " -f"1"))
for port in ${ports[@]}; do
echo $((0x${port}))
done | sort | uniq