Skip to content

Instantly share code, notes, and snippets.

@vifon
Created February 23, 2022 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vifon/b83c10342921a280aa8f547002219ad7 to your computer and use it in GitHub Desktop.
Save vifon/b83c10342921a280aa8f547002219ad7 to your computer and use it in GitHub Desktop.
Check for the remains of a program in the most likely places.
#!/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