Recursively find and delete Zone.Identifier files created by Windows
Project description
unzone
A simple, safe utility to find and delete Zone.Identifier files.
What are Zone.Identifier files?
When files are downloaded from the internet or transferred from other security zones in Windows, the OS creates hidden :Zone.Identifier alternate data stream files. When these files are copied to Linux or Mac systems (or accessed via WSL), they appear as separate files with the suffix :Zone.Identifier.
This tool helps clean them up.
Features
- ✅ Safe by default - Non-recursive by default, requires
-rflag for subdirectories - ✅ Confirmation prompts - Always asks for confirmation before deletion (configurable)
- ✅ Configurable - Set your preferred behavior globally
- ✅ Cross-platform - Works on Windows, Linux, and macOS
- ✅ No dependencies - Uses only Python standard library
- ✅ Verbose mode - See exactly what's being processed
- ✅ Smart error handling - Handles permission issues gracefully
Installation
pip install unzone
Usage
Basic usage (interactive)
# Scan current directory only (non-recursive)
unzone
# Scan current directory and all subdirectories
unzone -r
# Scan specific directory (non-recursive)
unzone /path/to/directory
# Recursively scan specific directory
unzone -r /path/to/directory
# See detailed output
unzone --verbose
Configuration
# Configure default behavior (one-time setup, runs first time you use unzone)
unzone --configure
This lets you choose whether to always ask for confirmation or auto-delete. Your choice is saved globally.
Command-line flags
# Recursive scan
unzone -r
unzone --recursive
# Force deletion without confirmation (for scripts)
unzone --force
# Force confirmation prompt (override config when set to automatically delete)
unzone --confirm
# Verbose output
unzone --verbose
# Show version
unzone --version
# Show help
unzone --help
Examples
# Clean current directory only
unzone
# Clean current directory and all subdirectories
unzone -r
# Clean Downloads folder (non-recursive)
unzone ~/Downloads
# Recursively clean Downloads folder
unzone -r ~/Downloads
# Automated cleanup in a script (recursive)
unzone -r ~/Downloads --force
# Override auto-delete config for this run
unzone ~/Downloads --confirm
Configuration File
Configuration is stored at:
- Linux/Mac:
~/.config/unzone/config.json - Windows:
%LOCALAPPDATA%\unzone\config.json
You can edit this file manually or use unzone --configure.
How It Works
- Scans the specified directory (use
-rfor recursive subdirectory scanning) - Finds all files ending with
Zone.Identifier - Asks for confirmation (unless configured otherwise or
--forceis used) - Deletes the files and reports results
Safety Features
- Non-recursive by default - Only scans the current directory unless
-ris specified - Confirmation prompts - Won't delete anything without your approval (by default)
- Graceful error handling - Continues processing even if some files can't be deleted
- Clear reporting - Shows exactly what was deleted and any errors
- Targeted deletion - Only removes files ending with
Zone.Identifier
License
MIT License - See LICENSE file for details
Contributing
Issues and pull requests welcome at https://github.com/spenquatch/unzone
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unzone-0.1.0.tar.gz.
File metadata
- Download URL: unzone-0.1.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e84ff7a5c809bc095ca14270b40b464f278392f9c869fc428e3de0beae7f770
|
|
| MD5 |
b71228e7b32689dfd641cd8375886b1b
|
|
| BLAKE2b-256 |
4bead3c9354b5e3fd4b6834217491e0962b9e5ffbd9921472d05957c27da8dce
|
Provenance
The following attestation bundles were made for unzone-0.1.0.tar.gz:
Publisher:
publish.yml on Spenquatch/unzone
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
unzone-0.1.0.tar.gz -
Subject digest:
2e84ff7a5c809bc095ca14270b40b464f278392f9c869fc428e3de0beae7f770 - Sigstore transparency entry: 674716194
- Sigstore integration time:
-
Permalink:
Spenquatch/unzone@26936df16ea71304e316ce6ff5c727e79e630fe6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Spenquatch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@26936df16ea71304e316ce6ff5c727e79e630fe6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file unzone-0.1.0-py3-none-any.whl.
File metadata
- Download URL: unzone-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a83452fe98153a53f8ea63e6a91f50b4bc71c5840b9d08793fb4e64930014e0
|
|
| MD5 |
daff96ad0bd30b345b024cb1c7db9ff9
|
|
| BLAKE2b-256 |
84380aaf49d12ea2d2ea66ba80f83d89723cb878d0b1c59c7f5dc505db3d1894
|
Provenance
The following attestation bundles were made for unzone-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Spenquatch/unzone
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
unzone-0.1.0-py3-none-any.whl -
Subject digest:
6a83452fe98153a53f8ea63e6a91f50b4bc71c5840b9d08793fb4e64930014e0 - Sigstore transparency entry: 674716208
- Sigstore integration time:
-
Permalink:
Spenquatch/unzone@26936df16ea71304e316ce6ff5c727e79e630fe6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Spenquatch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@26936df16ea71304e316ce6ff5c727e79e630fe6 -
Trigger Event:
release
-
Statement type: