Skip to main content

Diff two directories recursively

Project description

difftree

difftree is a tool that diffs two directories. It recursively walks through the directories and lists files that are missing on either side.

By default difftree only checks whether a file is present or not, so files present on both sides but with different file sizes, permissions or content will not be listed. However, checking any of those can be enabled via the -s, -p, and -z flags respectively.

Usage

> difftree dir-a/ dir-b/
dir-a/                 <-> dir-b/
                       <-  file-only-in-dirb.txt
file-only-in-dir-a.txt  ->

The following options are available:

  -h, --help            show this help message and exit
  -p, --check-perms     Diff file permissions
  -s, --check-sizes     Diff file sizes
  -z, --check-hashes    Diff file hashes
  -d, --dir-norecurse   Show missing directories as a single entry (don't show files in the directory)
  -e exclude_regex, --exclude exclude_regex
                        Exclude files matching this regex

Install

The recommended way to install difftree is via pipx:

pipx difftree

Alternatives

UNIX built-in diff -rq dir1 dir2 works quite well.

rsync --dry-run -r --itemize-changes dir1 dir2 also works quite well, but doesn't list files that are present in dir2 but missing in dir1. It requires you to parse the quite terse change format e.g. >fcsT.... and >f+++++++.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

difftree-0.1.1.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

difftree-0.1.1-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page