[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

Windowsマシンで詳細なプロセス情報を取得する【tasklistコマンド】

こんにちは。
食べ放題でバッファオーバーフロー
システムソリューション部のかわです。

年末ですね。いや今年は暑かった。
来年は普段の生活でもう少し四季を感じたいなと思いました。

さて、年末にかけて忙しくなる方も多いかと思いますが、みなさんWindowsマシンのプロセス状況って
どうやって確認されてますか?ザッとだけ見たい場合はタスクマネージャーとかリソースモニターを使うと思います。
ただ視覚的にはわかりやすいけど、Linuxみたいにもっと詳しい情報を見たいってことありますよね。

⇩タスクマネージャー

⇩リソースモニター

そんなときに便利なのが「tasklist」コマンド。オプションで付加情報も表示したり、
csv形式で出力できたりと臨機応変に使えたりします。今回はこのコマンドについて紹介したいと思います。
(本記事ではWindows Server 2019を使用しますが、Windows10とか11でも挙動は同じです)

tasklistコマンドの使用例

手始めにコマンドプロンプトを起動して、何も考えずに「tasklist」コマンドを打ちます。

tasklist

すると、以下のようにプロセス一覧が表示されます。

(公式ドキュメントはこちらを参照)

デフォルトだと「イメージ名」「PID」「セッション名」「セッション」「メモリ使用量」の5項目のみなので、
もう少し詳細を出力したい場合はオプションを付与します。ヘルプは以下で表示できます。

tasklist /?

詳細を表示

/v と付けるだけで色々な情報が取得できます。

tasklist /v

メモリやステータス、実行時間も一目瞭然です。

100MB以上メモリを使用しているプロセスを表示

▶ 手っ取り早くメモリ使用の多いプロセスを特定したいときに便利です。

tasklist /fi "memusage gt 100000"

CSV形式でプロセス出力

カンマ区切りでも出力できます。他にもTABLE(デフォルト)、LISTが指定可能。

tasklist /v /fo csv

⇩⇩⇩このままでは見にくいですが、

⇩⇩⇩そのままスプレッドシートに貼り付けるとこんな感じで確認ができて、ソートもほどよくできるので便利。

モジュール名で検索

あまり使わないかも?⇩で例えば「win*」を先頭に含むモジュールのプロセスを表示します。

tasklist /m win*

以上、このあたりを使って調査すればメモリ使用量の高いプロセスの特定や、
どのようなプロセスが動いているかの詳細な調査が可能だと思います。
ぜひ使ってみてください。

この記事がお役に立てば【 いいね 】のご協力をお願いいたします!
14
読み込み中...
14 票, 平均: 1.00 / 114
4,733
X facebook はてなブックマーク pocket
[2024.6.30 CentOS support ended] CentOS server migration solution

[2024.6.30 CentOS support ended] CentOS server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

The person who wrote this article

About the author

Kawa Ken


A curious Poke○n who belongs to the System Solution Department.