【Linux FAQ】あるパッケージに含まれるファイルの一覧を見るにはどうすればいいですか?

Ubuntu/Debian系ならdpkg -L パッケージ名、Fedora/CentOSなどRed Hat系ならrpm -ql パッケージ名を使います。

Ubuntu/Debian系で「bash」パッケージのファイル一覧を出力する例

$ dpkg -L bash
/.
/bin
/bin/bash
/etc
/etc/bash.bashrc
/etc/skel
/etc/skel/.bash_logout
/etc/skel/.bashrc
/etc/skel/.profile
/usr
/usr/bin
/usr/bin/bashbug
/usr/bin/clear_console
/usr/share
/usr/share/doc
/usr/share/doc/bash
/usr/share/doc/bash/COMPAT.gz
/usr/share/doc/bash/INTRO.gz
/usr/share/doc/bash/NEWS.gz
/usr/share/doc/bash/POSIX.gz
/usr/share/doc/bash/RBASH
/usr/share/doc/bash/README
/usr/share/doc/bash/README.Debian.gz
/usr/share/doc/bash/README.abs-guide
/usr/share/doc/bash/README.commands.gz
/usr/share/doc/bash/changelog.Debian.gz
/usr/share/doc/bash/copyright
/usr/share/doc/bash/inputrc.arrows
/usr/share/info
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/bash
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/bash.1.gz
/usr/share/man/man1/bashbug.1.gz
/usr/share/man/man1/clear_console.1.gz
/usr/share/man/man1/rbash.1.gz
/usr/share/man/man7
/usr/share/man/man7/bash-builtins.7.gz
/usr/share/menu
/usr/share/menu/bash
/bin/rbash

Fedora/CentOSなどRed Hat系で「coreutils」パッケージのファイル一覧を出力する例

$ rpm -ql coreutils
/usr/bin/[
/usr/bin/arch
/usr/bin/b2sum
/usr/bin/base32
/usr/bin/base64
/usr/bin/basename
/usr/bin/cat
/usr/bin/chcon
/usr/bin/chgrp
/usr/bin/chmod
/usr/bin/chown
/usr/bin/cksum
/usr/bin/comm
/usr/bin/cp
/usr/bin/csplit
/usr/bin/cut
/usr/bin/date
/usr/bin/dd
/usr/bin/df
/usr/bin/dir
/usr/bin/dircolors
/usr/bin/dirname
/usr/bin/du
/usr/bin/echo
/usr/bin/env
/usr/bin/expand
/usr/bin/expr
/usr/bin/factor
/usr/bin/false
/usr/bin/fmt
/usr/bin/fold
/usr/bin/groups
/usr/bin/head
/usr/bin/hostid
/usr/bin/id
/usr/bin/install
/usr/bin/join
/usr/bin/link
/usr/bin/ln
/usr/bin/logname
/usr/bin/ls
/usr/bin/md5sum
/usr/bin/mkdir
/usr/bin/mkfifo
/usr/bin/mknod
/usr/bin/mktemp
/usr/bin/mv
/usr/bin/nice
/usr/bin/nl
/usr/bin/nohup
/usr/bin/nproc
/usr/bin/numfmt
/usr/bin/od
/usr/bin/paste
/usr/bin/pathchk
/usr/bin/pinky
/usr/bin/pr
/usr/bin/printenv
/usr/bin/printf
/usr/bin/ptx
/usr/bin/pwd
/usr/bin/readlink
/usr/bin/realpath
/usr/bin/rm
/usr/bin/rmdir
/usr/bin/runcon
/usr/bin/seq
/usr/bin/sha1sum
/usr/bin/sha224sum
/usr/bin/sha256sum
/usr/bin/sha384sum
/usr/bin/sha512sum
/usr/bin/shred
/usr/bin/shuf
/usr/bin/sleep
/usr/bin/sort
/usr/bin/split
/usr/bin/stat
/usr/bin/stdbuf
/usr/bin/stty
/usr/bin/sum
/usr/bin/sync
/usr/bin/tac
/usr/bin/tail
/usr/bin/tee
/usr/bin/test
/usr/bin/timeout
/usr/bin/touch
/usr/bin/tr
/usr/bin/true
/usr/bin/truncate
/usr/bin/tsort
/usr/bin/tty
/usr/bin/uname
/usr/bin/unexpand
/usr/bin/uniq
/usr/bin/unlink
/usr/bin/users
/usr/bin/vdir
/usr/bin/wc
/usr/bin/who
/usr/bin/whoami
/usr/bin/yes
/usr/libexec/coreutils/libstdbuf.so
/usr/sbin/chroot

更新履歴

2017-10-08 Ubuntu 17.10、CentOS 7で動作を確認