miriwoのブログ

IT系の技術や少し趣味よりのことも投稿してゆくよ😊

Windows10のPCでduコマンドを実行できるようにする

概要

  • Windows10のPCでduコマンドを使えるようにする方法をまとめる。

方法

  1. 下記にアクセスする。
  2. ダウンロードボタンをクリックしてダウンロードする。
  3. ダウンロードされたzipファイルを開く。
  4. C:\Windows\System32直下にdu.exeをコピーする。
  5. コマンドプロンプトを開く。
  6. 「du」と入力しEnterを押下すると下記のように表示されればコマンドの導入は成功である。

    du

    DU v1.62 - Directory disk usage reporter Copyright (C) 2005-2018 Mark Russinovich Sysinternals - www.sysinternals.com

    usage: du [-c[t]] [-l | -n | -v] [-u] [-q] -c Print output as CSV. Use -ct for tab delimiting. Use -nobanner to suppress banner. -l Specify subdirectory depth of information (default is one level). -n Do not recurse. -q Quiet. -nobanner Do not display the startup banner and copyright message. -u Count each instance of a hardlinked file. -v Show size (in KB) of all subdirectories.

    CSV output is formatted as: Path,CurrentFileCount,CurrentFileSize,FileCount,DirectoryCount,DirectorySize,DirectorySizeOnDisk