How to use `which`?

QuestionsQuestions8 SkillsProInstall and Verify HydraAug, 31 2025
0102

The which command is used in Unix-like operating systems to locate the executable file associated with a command. Here's how to use it:

Basic Syntax:

which [options] command_name

Example Usage:

  1. Find the path of a command:

    which python

    This will return the path to the python executable, such as /usr/bin/python.

  2. Check multiple commands at once:

    which git node npm

    This will return the paths for git, node, and npm if they are installed.

Common Options:

  • --help: Displays help information about the command.
  • --version: Shows the version of the which command.

Note:

If the command is not found, which will not return any output.

If you have further questions or need examples, feel free to ask!

0 Comments

no data
Be the first to share your comment!