Skip to main content

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 -r flag 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

  1. Scans the specified directory (use -r for recursive subdirectory scanning)
  2. Finds all files ending with Zone.Identifier
  3. Asks for confirmation (unless configured otherwise or --force is used)
  4. Deletes the files and reports results

Safety Features

  • Non-recursive by default - Only scans the current directory unless -r is 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unzone-0.1.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unzone-0.1.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

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

Hashes for unzone-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2e84ff7a5c809bc095ca14270b40b464f278392f9c869fc428e3de0beae7f770
MD5 b71228e7b32689dfd641cd8375886b1b
BLAKE2b-256 4bead3c9354b5e3fd4b6834217491e0962b9e5ffbd9921472d05957c27da8dce

See more details on using hashes here.

Provenance

The following attestation bundles were made for unzone-0.1.0.tar.gz:

Publisher: publish.yml on Spenquatch/unzone

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for unzone-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a83452fe98153a53f8ea63e6a91f50b4bc71c5840b9d08793fb4e64930014e0
MD5 daff96ad0bd30b345b024cb1c7db9ff9
BLAKE2b-256 84380aaf49d12ea2d2ea66ba80f83d89723cb878d0b1c59c7f5dc505db3d1894

See more details on using hashes here.

Provenance

The following attestation bundles were made for unzone-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Spenquatch/unzone

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page