# ncdu-compare
Compare ncdu export files and shows differences to find out what consumes most space.
## Installation
~~~
# from pypi
pip3 install ncdu-compare
# ... or from git
pip3 install git+https://github.com/yaroslaff/ncdu-compare.git
~~~
## Example usage
~~~bash
# measure current /var/log
$ ncdu /var/log/ -0o /tmp/1
# create extra 1M file... and just wait
$ sudo dd if=/dev/zero of=/var/log/zzz.log bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.00229604 s, 457 MB/s
# measure /var/log again
$ ncdu /var/log/ -0o /tmp/2
# see top usage
$ ncdu-compare /tmp/1 /tmp/2 | sort -n | tail -n 5
575 FILE /var/log/auth.log (273797 > 274372)
12209 FILE /var/log/daemon.log (62452009 > 62464218)
12286 FILE /var/log/syslog (63463377 > 63475663)
1048576 FILE /var/log/zzz.log (0 > 1048576)
1074015 DIR /var/log (3895153251 > 3896227266)
~~~
## Invalid unicode filenames
Sometimes ncdu can produce invalid JSON files (see https://dev.yorhel.nl/ncdu/jsonfmt). When loading ncdu files ncdu-compare uses (default) 'replace' mode to handle unicode errors. You can override it with `-e`/`--error` options, e.g. `--error ignore`. More at python doc to [open()](https://docs.python.org/3/library/functions.html#open).
## See also
My other project [Plus Size](https://github.com/yaroslaff/pluss) to detect changes in short-time (e.g. fast growing log files)
[ncdu-diff](https://github.com/lilydjwg/ncdu-diff) C + Python ncdu fork that can compare and diff results
Raw data
{
"_id": null,
"home_page": "https://github.com/yaroslaff/ncdu-compare",
"name": "ncdu-compare",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Yaroslav Polyakov",
"author_email": "yaroslaff@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/37/4d/2efd358c16ef3b0f68fb1ee9373d504db033f0d0cfebc58049b285dba620/ncdu-compare-0.0.7.tar.gz",
"platform": null,
"description": "# ncdu-compare\nCompare ncdu export files and shows differences to find out what consumes most space.\n\n## Installation\n\n~~~\n# from pypi\npip3 install ncdu-compare\n\n# ... or from git\npip3 install git+https://github.com/yaroslaff/ncdu-compare.git\n~~~\n\n## Example usage\n\n~~~bash\n# measure current /var/log \n$ ncdu /var/log/ -0o /tmp/1\n\n# create extra 1M file... and just wait\n$ sudo dd if=/dev/zero of=/var/log/zzz.log bs=1M count=1\n1+0 records in\n1+0 records out\n1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.00229604 s, 457 MB/s\n\n# measure /var/log again\n$ ncdu /var/log/ -0o /tmp/2\n\n# see top usage\n$ ncdu-compare /tmp/1 /tmp/2 | sort -n | tail -n 5\n575 FILE /var/log/auth.log (273797 > 274372)\n12209 FILE /var/log/daemon.log (62452009 > 62464218)\n12286 FILE /var/log/syslog (63463377 > 63475663)\n1048576 FILE /var/log/zzz.log (0 > 1048576)\n1074015 DIR /var/log (3895153251 > 3896227266)\n~~~\n\n## Invalid unicode filenames\nSometimes ncdu can produce invalid JSON files (see https://dev.yorhel.nl/ncdu/jsonfmt). When loading ncdu files ncdu-compare uses (default) 'replace' mode to handle unicode errors. You can override it with `-e`/`--error` options, e.g. `--error ignore`. More at python doc to [open()](https://docs.python.org/3/library/functions.html#open).\n\n## See also\n\nMy other project [Plus Size](https://github.com/yaroslaff/pluss) to detect changes in short-time (e.g. fast growing log files)\n\n[ncdu-diff](https://github.com/lilydjwg/ncdu-diff) C + Python ncdu fork that can compare and diff results\n\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "ncdu-compare",
"version": "0.0.7",
"project_urls": {
"Homepage": "https://github.com/yaroslaff/ncdu-compare"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "aae836970096936c53bb46c741bacac593e5177d4ad8442e0e56fff6f39a5b19",
"md5": "41437b3f1a1a7a25ac7ab83c7d869d17",
"sha256": "d40e43a05ad9dfad06f1b0a75a1568548177501885b1a56022b72c6e2974e7bc"
},
"downloads": -1,
"filename": "ncdu_compare-0.0.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "41437b3f1a1a7a25ac7ab83c7d869d17",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4164,
"upload_time": "2023-06-14T12:46:12",
"upload_time_iso_8601": "2023-06-14T12:46:12.234549Z",
"url": "https://files.pythonhosted.org/packages/aa/e8/36970096936c53bb46c741bacac593e5177d4ad8442e0e56fff6f39a5b19/ncdu_compare-0.0.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "374d2efd358c16ef3b0f68fb1ee9373d504db033f0d0cfebc58049b285dba620",
"md5": "1ee1c703e6f8a5193ddd8b11af9ee069",
"sha256": "17b0daf7aba2beb42b8f40d79f190d315c2f3896a983c7c718e494d720199f4f"
},
"downloads": -1,
"filename": "ncdu-compare-0.0.7.tar.gz",
"has_sig": false,
"md5_digest": "1ee1c703e6f8a5193ddd8b11af9ee069",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3388,
"upload_time": "2023-06-14T12:46:13",
"upload_time_iso_8601": "2023-06-14T12:46:13.944528Z",
"url": "https://files.pythonhosted.org/packages/37/4d/2efd358c16ef3b0f68fb1ee9373d504db033f0d0cfebc58049b285dba620/ncdu-compare-0.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-14 12:46:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yaroslaff",
"github_project": "ncdu-compare",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "ncdu-compare"
}