bulk_delete.dart is a command-line tool for deleting files and directories in bulk based on regular expression patterns.
To use bulk_delete.dart, run the following command:
dart bulk_delete.dart --dir /path/to/directory --folders --files [--verbose] [--dry-run]
where:
--diror-d: Specifies the directory to search in.--foldersor-f: Specifies the regex pattern for folders to delete.--filesor-i: Specifies the regex pattern for files to delete.--verboseor-v: Optional. Enables verbose output.--dry-runor-n: Optional. Runs the program in dry-run mode (no files will be deleted).
Here are some examples of how to use bulk_delete.dart:
// Deletes all folders that match the "old_data" pattern dart bulk_delete.dart --dir /path/to/directory --folders old_data --verbose
// Deletes all files that match the ".log" extension dart bulk_delete.dart --dir /path/to/directory --files .log$ --verbose
path: For working with file and directory paths.args: For parsing command-line arguments.glob: For finding files and directories based on glob patterns.