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.

Mac ポート処理

Last updated at Posted at 2020-03-05

Macでのポート処理

Macでポートを指定してプロセスを検索する方法

macでローカルにサーバーを立ち上げようとするとポートがすでに使用されているという表示がでることがある。
そのような時は

lsof -i -P | grep ポート番号

とすればpidが表示される。

プロセスを終了させる

kill pid番号

上記のコマンドで終了出来ない場合は

kill -9 pid番号

のようなオプションをつけると強制終了させることが出来る。

ローカルサーバーの停止方法

上記の様な、ポートがすでに使用されている状況は個人的には以前立てたサーバーを
正常に終了させていないことが理由となっていたことが多かった。
"control + c"で終了させればサーバーが正常に停止してくれる。

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?