This Banner is For Sale !!
Get your ad here for a week in 20$ only and get upto 15k traffic Daily!!!

How the which Command works on Linux


Once we are working servers, and even our native pc, completely different purposes could set up the identical piece of software program a number of occasions. For instance, it isn’t unusual to by accident have two variations of Node.JS put in on a server or pc.

Within the instance the place we have now a number of variations of Node.JS, it may be complicated which variations are working, or which might be used after we run the node command in a terminal window.

If we need to know the origins of a command, we are able to use the which command to search out the place it’s put in. The which command has the next syntax, [x], [y] and [z] are what we need to examine:

which [x] [y] [z]
Enter fullscreen mode

Exit fullscreen mode



Tips on how to use the which command on Linux or Mac

Lets use our Node.JS instance to begin with. If we need to know which Node.JS is getting used, we are able to merely kind the next:

which node
Enter fullscreen mode

Exit fullscreen mode

This may then return one thing like this:

/root/.nvm/variations/node/v14.15.1/bin/node
Enter fullscreen mode

Exit fullscreen mode



Checking a number of instructions with the which command on Linux or Mac

If we need to examine the situation of a number of instructions on Linux or Mac, we are able to use the same old which syntax, however simply separate every merchandise we need to examine with an area.

For instance, the beneath textual content checks each node, and postfix:

which node postfix
Enter fullscreen mode

Exit fullscreen mode

And for me, it returns this:

/root/.nvm/variations/node/v14.15.1/bin/node
/usr/sbin/postfix
Enter fullscreen mode

Exit fullscreen mode

The Article was Inspired from tech community site.
Contact us if this is inspired from your article and we will give you credit for it for serving the community.

This Banner is For Sale !!
Get your ad here for a week in 20$ only and get upto 10k Tech related traffic daily !!!

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to Contribute to us or want to have 15k+ Audience read your Article ? Or Just want to make a strong Backlink?