Skip to main content

compare two directories

Project description

Installation

Depending on if you want only this tool, the full set of PNU tools, or PNU plus a selection of additional third-parties tools, use one of these commands:

pip install pnu-dcmp
pip install PNU
pip install pytnix

DCMP(1)

NAME

dcmp - compare two directories, deduplicating if needed

SYNOPSIS

dcmp [--dedup] [-h|--nosymlinks] [-s|--silent|--quiet] [-v|--verbose] [--debug] [--help|-?] [--version] [--] directory1 directory2

DESCRIPTION

The dcmp utility compares two directories contents and writes the results to the standard output. By default, dcmp is silent if the directories are the same; if they differ, the differences are reported with a leading:

  • '!' if files contents are different
  • '+' if the file or directory appears in directory1 but not in directory2
  • '-' if the file or directory appears in directory2 but not in directory1
  • '=' if the files contents are identical and you used the -v|--verbose option

If you use the -s|--silent|--quiet option, differences won't be reported and the overall result will be returned though the exit status (thus stopping the comparison at the first difference).

By default, dcmp follows symbolic links to directories, unless you tell it not to do so with the -h|--nosymlinks option, or you use the --dedup option for deduplicating the first directory, removing identical files (ie. those having the same SHA-256 message digest) and symbolic links, as well as empty directories sitting there.

OPTIONS

The following options are available:

Options Use
--dedup In dir1, remove empty dirs and files which are identical to those in dir2
-h|--nosymlinks Do not follow symbolic links
-s|--silent|--quiet Print nothing for differing dirs; return exit status only
-v|--verbose Print identical dirs and files names
--debug Enable debug mode
--help|-? Print usage and a short help message and exit
--version Print version and exit
-- Options processing terminator

ENVIRONMENT

The DCMP_DEBUG environment variable can also be set to any value to enable debug mode.

EXIT STATUS

The dcmp utility exits with one of the following values:

  • 0: The directories are identical
  • 1: The directories are different
  • >1: An error occurred

SEE ALSO

cmp(1), sha256(1)

STANDARDS

The dcmp utility is not a standard UNIX command.

This implementation tries to follow the PEP 8 style guide for Python code.

PORTABILITY

To be tested under Windows.

HISTORY

This implementation was made for the PNU project.

The dcmp utility was made to help spot potential differences between restored backups and current files and directories.

LICENSE

It is available under the 3-clause BSD license.

AUTHORS

Hubert Tournier

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

pnu_dcmp-1.0.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

pnu_dcmp-1.0.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file pnu_dcmp-1.0.1.tar.gz.

File metadata

  • Download URL: pnu_dcmp-1.0.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for pnu_dcmp-1.0.1.tar.gz
Algorithm Hash digest
SHA256 fccfd25312723c768ca01ccf6575bd8d2dbdccb571b15c3c572cb183145041af
MD5 49343e0b93548c13505ee34da68018a9
BLAKE2b-256 dc6945ad72ed94f3f787fc59ae02911d0b52d1e8a12b2ed80c19cd85d653ecda

See more details on using hashes here.

File details

Details for the file pnu_dcmp-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pnu_dcmp-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for pnu_dcmp-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 285ae8375d1cec32d08600fd8063bad57508894d6a4f1a3f133c22cf48f7a242
MD5 eaa6aa012cd0c2142a27b5ea0d7f3ee6
BLAKE2b-256 8ad1df9ea45c477829ff4641bd753d3bc27f68896affa55a9b14ba705a72956d

See more details on using hashes here.

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