Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ubuntuでnetstatコマンドを実行して更新を続ける方法があることを知っています。誰か知っていますか?プロセスがソケットを開いたり閉じたりするタイミングを知りたい:
sudo netstat -lnp |grep 12239
で任意のコマンドをラップできますwatch。
watch
watch -n 60 "sudo netstat | head 10"
grepの代わりに式を使用できる場所head 10。これは 60 秒ごとに更新されるようになりました。 を参照してくださいman watch。
grep
head 10
man watch