0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Railsのプロセスを強制killする、ワンライナーのLinuxコマンド

Posted at

Railsはよくフリーズするので、Ctrl-Cでkillできないことがあります。
そういうときは以下のコマンドを使えば強制killできます。

lsof -i tcp:3000 | grep ruby | awk '{print $2}' | xargs kill -9

自分は以下のaliasで.zshrcに登録しています。
$2の前の\に注意!

alias rk="lsof -i tcp:3000 | grep ruby | awk '{print \$2}' | xargs kill -9"

参考

Rails sのプロセスが切れない時
Getting a zsh alias including a pipe to execute

0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?