LoginSignup
21

More than 5 years have passed since last update.

sshしつつtailを走らせるときに、ctrl + cでリモートのtailをkillする方法

Posted at

シェルスクリプト内で、sshでリモートのログをtailしたくなった場合のTips

ssh hostname "tail -f /path/to/log"

のようにすると、sshをctrl + cしてもリモート側のtailが走ったままになってしまう。
これを防ぐにはssh に -t オプションを付ければOK

ssh -t hostname "tail -f /path/to/log"

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
21