Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In linux, how to get the full path of a command I am using?

Tags:

linux

path

How to get the full path of a command I am using?

for example, I have installed jdk into /opt/Oracle/jdk1.7.0_25, and my PATH looks like this:

/opt/Oracle/jdk1.7.0_25/bin/:/usr/lib/x86_64-linux-gnu/qt4/bin:/home/unimous/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games. 

I want to get /opt/Oracle/jdk1.7.0_25/bin/java from java.

like image 611
Yishu Fang Avatar asked Sep 04 '13 05:09

Yishu Fang


1 Answers

which java

should give you the complete path.

This also works for any other command in Linux, just use which command_name.

like image 51
John Sparwasser Avatar answered Oct 06 '22 01:10

John Sparwasser