Created
February 23, 2022 16:17
-
-
Save vifon/b83c10342921a280aa8f547002219ad7 to your computer and use it in GitHub Desktop.
Check for the remains of a program in the most likely places.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
# Check for the remains of a program in the most likely places. | |
# Useful when testing new software or removing no longer used one. | |
if command -v exa > /dev/null | |
set ls exa | |
else | |
set ls ls --color=auto | |
end | |
set prefixes $HOME/. $HOME/.config/ $HOME/.local/share/ $HOME/.cache/ | |
set patterns $prefixes$argv | |
set matches $patterns* | |
if count $matches > /dev/null | |
printf 'Found the following matching remains:\n' | |
command $ls -lh -d $matches | |
else | |
printf 'No matches. Checked glob patterns:\n' | |
printf -- '- %s*\n' $patterns | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment