Where to start First steps track · 15 stages
Linux Labs

which / type / whereis — where a command lives

cheat sheet · bash https://lab.dimsanych.ru/en/wiki/which/

Cheat sheet

  • type -a cmd alias/builtin/function/file — every match
  • command -v cmd a path or nothing (for scripts)
  • which cmd just the path to the file
  • whereis cmd binary + 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.

Loading…