20
15

More than 5 years have passed since last update.

一行野郎:1秒おきにportを確認(コマンド繰り返し)

Posted at

効果

1秒おきにportを確認。
コマンド繰り返しなので、別にportでなくてもよいけれど。

一行野郎

while true; do netstat -a | grep "ssh"; sleep 1s; done;
netstat の所と grep の所を変えれば、いくらでも応用できて便利。
sleep 1 はお好みで。
while true; do netstat -a | grep "ssh" |tee -a hoge.log; sleep 1s; done;
保存するなら tee をはさんでもいい。

必要な物

  • bash
  • netstat
  • grep
20
15
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
20
15