user@host:$ dpkg -S /bin/ls coreutils: /bin/ls user@host:$ dpkg -S ls | wc -l 12831
Works similar to dpkg -S, but uses the locatedb and is thus inarguably a lot faster - if the locatedb is current.
Uses dpkg -S or apt-file to find the file you want and shows results in various ways. Available at https://github.com/Pipeliner/configs/blob/master/bin/pacof
pacof -xp 'bin/[^/]*mixer'
alsamixergui
alsa-tools-gui
alsa-utils
...
Show Sample Output
Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?
You must be signed in to comment.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for:
apt-file -x search /some/file
dpkg -L packagename
equery belongs /some/file
dpkg -S ip | grep "/ip$"
Output: linux-headers-2.6.27-7-generic: /usr/src/linux-headers-2.6.27-7-generic/include/config/ip iproute: /bin/ip iproute: /sbin/ip First line of the output is a directory by name ls intalled by the package linux-headers-2.xxxx Second line is the executable by name ip The last line of the output is the symbolic link to the command ip You need to replace both instances of string ip with the command/file of your interest in my example command.dpkg -S `which ls`
You might know the command but not the full path, i.e. on Ubuntu 11.10:which ls
/bin/ls So your command would't actually tell you what package ls comes from on this distro.