LoginSignup
0
0

More than 5 years have passed since last update.

OSがわからなかった時に唯一使えた実行中のプロセスを確認する方法

Last updated at Posted at 2018-09-01

環境

不明

実装

リモートサーバーでサーバーを立てようとしたら

[Errno 98] Address already in use

というエラーが出たので色々調べて見たら

#Macの場合
$sudo lsof -i -P

#Windowsの場合
$sudo netstat -anob

#Linuxの場合
$sudo netstat -anp

ここから実行中のプロセスを発見し、PIDを参照してkillすれば終了、、、

なのだが、なぜか私が入ったリモートサーバーには全てのコマンドが使えない
おそらく権限がないからであろう

色々調べた結果、以下のコマンドだけ使えた

$ps -ax

ps コマンドを使用すると、システム上の全プロセスを表示できるらしい
ちなみに詳しくは以下の様子

オプション a
端末操作のプロセスを表示する。

オプション x
端末操作以外のプロセスを表示する。

こんなかから自分が使いたいポートを探し出し、成功したので一件落着

ただし、ポート番号から検索をかけられないのでそこは残念。。。

参考https://eng-entrance.com/linux-command-ps

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