diff options
author | Filipp Lepalaan <filipp@mac.com> | 2017-10-19 11:20:55 +0300 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2017-10-19 11:20:55 +0300 |
commit | 8d560d6cf854fea81e0e0a2b8a22c406de4febb3 (patch) | |
tree | 04d9c5d26a27c982da5cba86fe3f4fac53149914 /README.md | |
download | dirstat-master.tar.gz dirstat-master.tar.bz2 dirstat-master.zip |
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..4eac4ad --- /dev/null +++ b/README.md @@ -0,0 +1,65 @@ +### Introduction + +`dirstat` is a fairly crude, but surprisingly useful tool to generate different statistics about directory structures. + + +### Usage + +Let's say you have a network share mounted at /Volumes/SHARE. Let's import it into dirstat: + + $ dirstat.py import /Volumes/SHARE + + +After the tool is finished, we can use the sqlite3 command line to get some insight into the tree, without disturbing the +file system itself. Here are just a few examples: + +#### Top 10 file types by count + + sqlite> select type, count(*) as c from paths where import_id = 1 group by type order by c desc limit 10; + JPG|172592 + PDF|124481 + PNG|74889 + DWG|51314 + GSM|40811 + MXS|14726 + DOC|6479 + PSD|5640 + MXI|4745 + PLT|4684 + +#### Space usage in gigabytes by year (of modification date): + + sqlite> select strftime('%Y', mtime) as y, sum(size)/1024/1024/1024 as s from paths group by y order by s desc; + 2017|1300 + 2016|1256 + 2014|994 + 2015|974 + 2013|584 + 2012|260 + +#### File types and their counts in a given subdirectory: + + sqlite> select type, count(*) from paths where path like '%/PROJECTS/ACTIVE/%' group by type; + 3DM|3 + 3DMBAK|3 + AI|1 + BMP|1 + DIR|51 + DOC|65 + DOCX|7 + DOTX|1 + DWF|1 + DWG|8 + + +### System Requirements + +- Python 3 (tested with 3.6.3) + + +### License + + Copyright © 2017 Filipp Lepalaan <filipp@mac.com> + This work is free. You can redistribute it and/or modify it under the + terms of the Do What The Fuck You Want To Public License, Version 2, + as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. |