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
.
which java
should give you the complete path.
This also works for any other command in Linux, just use which command_name
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With