Skip to content

Packages and Binaries

When something behaves unexpectedly, confirm what binary is being executed and where it came from.

Terminal window
which <command>
type <command> # show whether it is a binary, alias, or shell builtin
whereis <command> # show likely binary and manpage locations
<command> --version
apt list --installed # list installed packages on Debian-based systems
dnf list installed # list installed packages on RPM-based systems
rpm -q <package> # query one RPM package by name
dpkg -l | grep <package> # search installed Debian packages

Binary path:

Terminal window
which <command>
readlink -f $(which <command>) # resolve symlinks to the real binary

Package ownership on Debian-based systems:

Terminal window
dpkg -S /path/to/file

Package ownership on RPM-based systems:

Terminal window
rpm -qf /path/to/file
  • Packaged binaries usually live in /usr/bin or /usr/sbin.
  • Locally installed tools often land in /usr/local/bin.
  • Custom software may live in /opt or a team-owned directory.
  • Multiple versions of the same command in PATH cause a lot of confusion.

Do not assume the binary you run interactively is the same one a service uses. Check ExecStart= in the unit file if systemd owns it.