Find files in one directory that are not in another

Mattias Jakobsson 0a9b7e592c Turned off email notifications from Travis [ci skip] 9 years ago
tests ae28bfb7e2 Attempt to import mock backport if unittest import fails 9 years ago
.gitignore d7054137d4 Added __pycache__ and /notin.egg-info to .gitignore 9 years ago
.travis.yml 0a9b7e592c Turned off email notifications from Travis [ci skip] 9 years ago
CHANGELOG.md 575b403b11 Added a CHANGELOG with an initial entry 9 years ago
LICENSE 6915756efc Initial commit 9 years ago
README.md 1df665227d Updated the README with install and usage instructions 9 years ago
notin.py d33496a66a Capitalized notin's metavars 9 years ago
setup.py f0b0b947c2 Merge branch 'release/0.1' into develop 9 years ago

README.md

notin Build Status

Find all files in one directory that are not in another.

Requirements

Python v3.2 or later, nothing more, nothing less!

Installation

$ pip install git+https://github.com/mjakob/notin.git

Usage

Notin is a very simple tool that was created so the author could remove a directory of old photos, after re-arranging them in a new directory, without worrying about losing any of them. Given two directories,

$ tree
.
├── a
│   ├── c
│   │   └── same.txt
│   ├── different.txt
│   └── same.txt
└── b
    ├── d
    │   └── same.txt
    ├── different.txt
    ├── same.txt
    └── unique.txt

4 directories, 7 files

notin finds all files in the second directory that are not present in the first. Notin uses md5sums and cares little about the directory structure and filenames.

$ notin a b
b/different.txt
b/unique.txt

The full help output is:

$ notin --help
usage: notin [-h] [-v] SOURCEDIR TARGETDIR

Find all files under TARGETDIR that are not under SOURCEDIR.

positional arguments:
  SOURCEDIR      a source directory
  TARGETDIR      a target directory to search for files not in SOURCEDIR

optional arguments:
  -h, --help     show this help message and exit
  -v, --verbose  turn on verbose output to stderr

License

Notin was written by Mattias Jakobsson and is release under the GNU General Public License version 3 or (at your option) any later version.