Find files in one directory that are not in another
|
9 years ago | |
---|---|---|
tests | 9 years ago | |
.gitignore | 9 years ago | |
.travis.yml | 9 years ago | |
CHANGELOG.md | 9 years ago | |
LICENSE | 9 years ago | |
README.md | 9 years ago | |
notin.py | 9 years ago | |
setup.py | 9 years ago |
Find all files in one directory that are not in another.
Python v3.2 or later, nothing more, nothing less!
$ pip install git+https://github.com/mjakob/notin.git
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
Notin was written by Mattias Jakobsson and is release under the GNU General Public License version 3 or (at your option) any later version.