which / type / whereis — where a command lives
cheat sheet · bash https://lab.dimsanych.ru/en/wiki/which/Cheat sheet
-
type -a cmdalias/builtin/function/file — every match -
command -v cmda path or nothing (for scripts) -
which cmdjust the path to the file -
whereis cmdbinary + man page + sources
Options
type -a and which -a show every match along $PATH, not just the
first one that would actually run — useful when a command behaves
unexpectedly and you suspect a version conflict. Plain which without
-a stops at the first file found and says nothing about aliases or
functions.