Linux / Unix which Command Examples To Find Out A Program File

The “which” command in Linux/Unix is used to determine the location of executable files in the system PATH. Here are some examples of using the “which” command:

  1. Find the location of a specific program:
which program-name

Replace “program-name” with the actual name of the program you want to find.

  1. Find the location of multiple programs:
which program-name1 program-name2 program-name3

Replace “program-name1”, “program-name2”, etc. with the actual names of the programs you want to find.

The “which” command searches the directories listed in the PATH environment variable, and returns the full path to the first executable file with the specified name that it finds. If the program is not found, “which” will return an error message.

These are some basic examples of using the “which” command. The “which” command is a useful tool for finding out the location of programs, and for determining if a program is installed on a system.

Leave a Comment