Skip to main content

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

Release files for pnu-dcmp 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pnu-dcmp 1.0.1
File Size Uploaded
pnu_dcmp-1.0.1.tar.gz 9.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pnu-dcmp 1.0.1
File Interpreter ABI Platform
pnu_dcmp-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.7 kB

Release files / pnu_dcmp-1.0.1.tar.gz

Download URL pnu_dcmp-1.0.1.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fccfd25312723c768ca01ccf6575bd8d2dbdccb571b15c3c572cb183145041af
BLAKE2b-256 checksum
How to use checksums
dc6945ad72ed94f3f787fc59ae02911d0b52d1e8a12b2ed80c19cd85d653ecda
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pnu_dcmp-1.0.1-py3-none-any.whl

Download URL pnu_dcmp-1.0.1-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
285ae8375d1cec32d08600fd8063bad57508894d6a4f1a3f133c22cf48f7a242
BLAKE2b-256 checksum
How to use checksums
8ad1df9ea45c477829ff4641bd753d3bc27f68896affa55a9b14ba705a72956d
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page