Skip to content

Check large sized file and directory on Windows

Gitbash: du

du is unix command line supported on gitbash.

Run

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
$ du -ak ./ | egrep -v 'env1|.git' | sort -n -r | head -n 20
247770  ./
123894  ./2021/labs/kannai/site
123894  ./2021/labs/kannai
123894  ./2021/labs
123894  ./2021
122911  ./tatsuro.homma/fabacademy
122911  ./tatsuro.homma
1518    ./2021/labs/kannai/site/docs
1059    ./2021/labs/kannai/site/docs/instruction
965     ./fabacademy-student-template
948     ./2021/labs/kannai/site/docs/instruction/images
804     ./2021/labs/kannai/site/docs/instruction/images/win_path.png
576     ./tatsuro.homma/fabacademy/docs
505     ./tatsuro.homma/fabacademy/docs/images
459     ./fabacademy-student-template/docs
353     ./fabacademy-student-template/docs/images
353     ./2021/labs/kannai/site/docs/images
152     ./tatsuro.homma/fabacademy/docs/images/content
132     ./tatsuro.homma/fabacademy/docs/images/week01/assignment-photo.jpg
132     ./tatsuro.homma/fabacademy/docs/images/week01
du
  • a : Write counts for all files, not just directories.
  • k : Like –block-size=1K.
  • ./ : target directory. In this case, current directory
egrep
  • v : search exclude
  • ‘word’ : search target word with regular expression
sort
  • n : sort by number
  • r : reverse order
head
  • n : display number of row from head

WSL2 : ncdu

Install

On WSL2,

1
2
$ sudo apt update
$ sudo apt install ncdu

Run

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$ ncdu
ncdu 1.14.1 ~ Use the arrow keys to navigate, press ? for help
--- /home/tato/repo/gilab_fab/FA2020/tatsuro-homma/assignment -------------------------
                         /..                                                              64.0 KiB [##########]  week17.html
   48.0 KiB [#######   ]  week06.html
   44.0 KiB [######    ]  week15.html
   44.0 KiB [######    ]  week07.html
   44.0 KiB [######    ]  week09.html
   40.0 KiB [######    ]  week14.html
   36.0 KiB [#####     ]  week03.html
   36.0 KiB [#####     ]  week08.html
   36.0 KiB [#####     ]  week12.html
   32.0 KiB [#####     ]  week02.html
   28.0 KiB [####      ]  week11.html
   28.0 KiB [####      ]  week04.html
   24.0 KiB [###       ]  week16.html
   24.0 KiB [###       ]  week05.html
   24.0 KiB [###       ]  week01.html
   12.0 KiB [#         ]  week13.html
    8.0 KiB [#         ]  index.html
    8.0 KiB [#         ]  week00_template.html
    8.0 KiB [#         ]  week10.html
    4.0 KiB [          ]  week06_echoboard1614_BOM.html

Last update: January 29, 2021