which Command in Linux: Finding the Full Path of a Command
Linuxcommands
The which command in Linux takes a command name as an argument and returns the location on disk of that command, in the directories referenced in the PATH variable. It is especially useful when you are testing different versions of a command and want to make sure you are running the correct version.
Examples:
$ which php/usr/bin/php
$ which nginx/usr/sbin/nginx
$ which python/usr/bin/python
$ which perl/usr/bin/perl
The command is very similar to whereis, but it returns only the full path of the executables.
Learn much more about Linux in our online course. You can enroll here. If you already have an account, or want to create one, just log in or create your user here.
Liked it? Share
That was just one piece. The course teaches the whole path — from your first command to exam day.