Help us understand the problem. What is going on with this article?

ネットワーク系コマンドチートシート(Linux)

  • Debian10 で動くはずです
  • macOS版はこちら

インターフェースのup/down

sudo ip link set eth0 up

LISTENしているポートの一覧を表示する

netstatを使う場合

netstat -ant
  • -n 名前解決をしない
  • -t TCPポートを表示

ssを使う場合

ss -lt4
  • -l LISTEN中のソケットを表示
  • -t TCPソケットを表示
  • -4 IPv4を表示

ssでポートをLISTENしているプロセスも表示する

  • root権限が必要
sudo ss -ltp4

現在のネットワークの帯域を見たい

kbpsをざっくりと表示する

prev_b=0; while :; do b="$(cat /proc/net/dev | grep ppp0 | sed 's/^ *//' | tr -s ' ' | cut -d ' ' -f 10)"; echo "$(((b - prev_b) * 8 / 1000))"; prev_b=$b; sleep 1; done
realglobe
「世界のすべてをWebAPI化する」ことを目指す技術ベンチャーです。
https://realglobe.jp
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした