Here are a few options, these will list all the files installed by a package:
A. Listing all files included in a package
For installed packages
dpkg -L ncurses-term
For all packages, installed or not
apt-file -F list ncurses-term
The -F
turns of pattern matching so that only packages whose exact name matches are returned. You may need to install apt-file
with sudo apt-get install apt-file
and then update its database with sudo apt-file update
.
B. Listing only executable files included in a package
- For installed packages
Just install dlocate
(sudo apt-get install dlocate
) and run:
dlocate -lsbin ncurses-term
As explained in man dlocate
:
-lsbin List full path/filenames of executable files (if any) in package
If you don't want to install additional packages, you can do this manually. Just collect the list of files and find any among them that have the executable bit set:
apt-file -F list ncurses-term | cut -d ' ' -f 2 |
while read file; do [[ -x $file && -f $file ]] && echo "$file"; done
The little scriptlet above will print the path only (cut -d ' ' -f 2
) and then pass it through a while
loop that checks if the file is executable (-x $file
) and if it is a regular file, no directories or symlinks (-f $file
) and prints its name only if passes both tests.
- For all packages, installed or not
There is no way I know of to list only executables included in an uninstalled package. However, since most executables are installed to bin
directories, you can get most of them by parsing the output:
apt-file -F list ncurses-term | grep -Ew "bin|sbin"
The -w
option matches entire words, so you don't get things installed in, for example, trashbin
or whatever.
NOTE: None of the above commands will produce any output for ncurses-term
but that is because this package installs no executable files. The commands work nevertheless, try with a different package.