Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How can I get a list of commands that have been installed with a particular package?

For example, if I install Chromium, what should type now? Or if I install moreutils, how do I know which commands have been installed?

share|improve this question
add comment

1 Answer

up vote 11 down vote accepted

Short answer:

dpkg -L packagename | grep 'bin/'

Long answer:

To get a list of all files installed in a package (say moreutils), run this command:

dpkg -L moreutils

Now, all we need to do is filter out the ones that are executable files in the path. In general, commands are installed to /bin, /sbin, /usr/bin and /usr/sbin, so we can simply match those patterns:

dpkg -L moreutils | grep -e '^/bin/' -e '^/sbin/' -e '^/usr/bin/' -e '^/usr/sbin/'

If you want something that's easier to memorise, but not completely accurate, just filter out lines with bin/ instead:

$ dpkg -L moreutils | grep 'bin/'
/usr/bin/isutf8
/usr/bin/pee
/usr/bin/errno
/usr/bin/vidir
/usr/bin/zrun
/usr/bin/lckdo
/usr/bin/ifne
/usr/bin/mispipe
/usr/bin/parallel
/usr/bin/sponge
/usr/bin/ts
/usr/bin/ifdata
/usr/bin/vipe
/usr/bin/chronic
/usr/bin/combine

So, in this example, I have discovered these commands: isutf8, pee, errno, etc.


Some packages don't install commands into the path, but do install an icon for the GUI app. If you want to find the command that launches the application, you will need to find the installed .desktop file, and look at the line beginning with Exec=. For example:

$ dpkg -L worldofgoo | grep '\.desktop$'
/usr/share/applications/WorldOfGoo.desktop

$ grep '^Exec=' /usr/share/applications/WorldOfGoo.desktop 
Exec=/opt/WorldOfGoo/WorldOfGoo

So in this example, I have discovered that I should run /opt/WorldOfGoo/WorldOfGoo to launch World Of Goo from the terminal.

share|improve this answer
1  
The grep part can be consolidated slightly based on the idea that all patterns end with bin/. (And I was unable to resist to trim the path names.) dpkg -L moreutils | grep -e '/[s]*bin/' | sed -r 's/.*bin\/(.*)$/\1/' –  lgarzo Dec 31 '12 at 17:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.