Last active
September 17, 2023 17:31
-
-
Save jamiew/f92d5cd656230d0bd24fa64442400e42 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
app="$1" | |
if [ -z "$app" ]; then | |
echo "$0: specify binary/app name as first and only argument" | |
exit 1 | |
fi | |
echo | |
echo "which: $(which "$app")" | |
echo "command -v: $(command -v "$app")" | |
echo "type: $(type "$app")" | |
readlink=$(readlink $(command -v "$app")) | |
[ -z "$readlink" ] && echo "readlink: not a symlink" || echo "readlink: it's a symlink to $readlink" | |
# other ideas: | |
# strings /path/to/binary | grep -i "some clue" | |
# lsattr /path/to/binary -- linux only | |
echo | |
echo check package managers... | |
echo "npm?: " | |
npm list -g --parseable --depth 0 | grep "$app" | |
echo "pnpm?: " | |
pnpm list -g --parseable --depth 0 | grep "$app" | |
echo "yarn?: " | |
yarn global list | grep "$app" | |
echo "cargo?: " | |
cargo install --list | grep "$app" | |
echo "pip?: " | |
pip list | grep "$app" | |
echo "homebrew?: " | |
brew list | grep "$app" | |
# apt? | |
# snap? | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment