Skip to content

Instantly share code, notes, and snippets.

@umhan35
Created January 5, 2014 03:19
Show Gist options
  • Save umhan35/8263882 to your computer and use it in GitHub Desktop.
Save umhan35/8263882 to your computer and use it in GitHub Desktop.
which package is this file
#!/bin/sh
if [ $# -ne 1 ]; then
echo "usage: $(basename $0) command"
exit 1
fi
set -e
var=$(which $1)
var=$(dpkg -S $var)
echo $var
var=$(echo -n $var | cut -d: -f1)
dpkg -L $var | less -f
#unset var
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment