Skip to content

Output Cleaning

The igir clean command can be used when writing (igir copy, igir move, and igir link) to delete files from the --output <path> directory that are either:

The golden rule

The golden rule of the igir clean command is it will not delete files in any directory tree that it did not write to.

In practical terms, this means:

1. If no file was written (i.e. no input file matched any ROM in any DAT), then igir clean will not delete any files.

2. If tokens are used with the --output <path> option, only subdirectories that are written to will be considered for cleaning.

For example, if the output directory is specified as --output "games/{mister}", and only Game Boy Color games are found in --input <path>, then only the games/Gameboy/ directory would be considered for cleaning. Other directories that may already exist such as games/GBA/ and games/NES/ would not be considered for cleaning, as igir did not write there.

In other words, games/{mister} is not equivalent to games/*. igir will not indiscriminately delete files in games/.

If you want to clean every directory in games/, you could specify it as both the --input <path> and --output <path>:

igir move clean --dat "*.dat" --input "games\" --output "games\{mister}\"
igir move clean --dat "*.dat" --input "games/" --output "games/{mister}/"
igir move clean --dat "*.dat" --input "games/" --output "games/{mister}/"


The --clean-exclude <path> option exists so that one or more paths (with support for globbing) can be excluded from deletion.

See the Analogue Pocket page for a practical example.

Dry run

The --clean-dry-run option exists to see what paths igir clean would delete, without actually deleting them.


You will want to set the log level to at least DEBUG (-vv) in order to see actions that were skipped, such as cleaning.


igir [commands..] clean [options] --clean-dry-run -vv
igir [commands..] clean [options] --clean-dry-run -vv
igir [commands..] clean [options] --clean-dry-run -vv