Find a command and understand how to use it with which and type — Cheat Sheet Linux

which

which <COMMAND> displays the path to the executed command when the <COMMAND> command is executed.

The arguments are:

  • -a <COMMAND>: displays the matches in the PATH variable in the order of execution.

type

type describes a command and indicates how it works.

The arguments are:

  • -a: lists the variants of the specified command.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store