Last Updated: February 25, 2016
·
734
· jasdeepkhalsa

The most useful Shell command

Often I need to know the path to a program, e.g. to sh for writing a shell script or to svn or git, for this there is a simple shell command called which.

Usage:

which sh

Outputs:

/bin/sh

Which I can then use in a shell script with a shebang (#!), like so:

#!/bin/sh

Simples ;)