lsunregister
is a command line interface to batch deregister applications in macOS LaunchServices database, using a prefix, a pattern or a regular expression.
lsunregister
can also provide a clean list of all registered applications in LaunchServices database.
lsunregister
uses LaunchServices framework private functions for maximum efficiency.
lsunregister --prefix / -p <prefix>
lsunregister --like / -l <pattern>
lsunregister --regex / -r <regular expression>
lsunregister --debug / -d : print all registered applications and exit.
lsunregister --prefix ~/.Trash/
lsunregister --like "/Volumes/*/.Trashes/*"
lsunregister --regex "/Users/.*?/(\.Trash|Desktop|Downloads|Library/Mail)/.*"
lsunregister --debug | sort