私はnetstat
出力を見ることに大きく依存しています。
sudo netstat -peanut
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 0 27575 1902/docker-proxy
tcp 0 0 127.0.0.1:5000 0.0.0.0:* LISTEN 0 26977 1519/docker-proxy
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 0 15340 537/rpcbind
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 0 20953 925/nginx: master p
tcp 0 0 0.0.0.0:8181 0.0.0.0:* LISTEN 0 25191 1236/haproxy
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 101 17893 716/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 0 20941 921/sshd
tcp 0 0 127.0.0.1:3000 0.0.0.0:* LISTEN 0 25193 1236/haproxy
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 0 20954 925/nginx: master p
tcp 0 0 172.18.0.1:44638 172.18.0.2:27017 TIME_WAIT 0 0 -
tcp 0 0 172.18.0.1:44774 172.18.0.2:27017 ESTABLISHED 0 31237 1528/docker-proxy
tcp 0 0 172.18.0.1:39470 172.18.0.3:27017 ESTABLISHED 0 32005 1574/docker-proxy
これは別の宝石です。
netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 1902/docker-proxy
tcp 0 0 127.0.0.1:5000 0.0.0.0:* LISTEN 1519/docker-proxy
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 537/rpcbind
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 925/nginx: master p
tcp 0 0 0.0.0.0:8181 0.0.0.0:* LISTEN 1236/haproxy
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 716/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 921/sshd
tcp 0 0 127.0.0.1:3000 0.0.0.0:* LISTEN 1236/haproxy
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 925/nginx: master p
tcp6 0 0 :::27017 :::* LISTEN 1594/docker-proxy
tcp6 0 0 :::587 :::* LISTEN 1915/docker-proxy
しかし、次のようなツールに置き換えnetstat
られるそうですss
。上記の現代的な方法に似た出力を生成する方法を知っている人はいますか?
sudo ss -l -p -n
sudo ss -tnlp
私の試みが十分ではなく、netstat
ss形式は人が読むのに適していませんか?
Debian/Ubuntu
ベストアンサー1
最初のコマンド:
ss -tap
2番目の順序
ss -tlp