I want to know where to which file/directory it takes me when I put it in the terminal for example $ python
. I already know that putting $ $PATH
it shows me the routes, but I want to read it in some file or know where it saves the information.
I want to know where to which file/directory it takes me when I put it in the terminal for example $ python
. I already know that putting $ $PATH
it shows me the routes, but I want to read it in some file or know where it saves the information.
you can do it in several ways:
With the built-in
command
andls
For example, in my case.
With
readlink
With
command -v programa
shows the file to be executed when calling program , but does not execute it.readlink
follows symlinks, and the option-f
prefers that all but the last path it links to exist, unlike the-e
.And well, you know what you do
ls -l
If, after trying the above, you put in your terminal
command -v python
, you will see the difference since the output of that command only shows you the path to/usr/bin/python
but this path is only a symbolic link to the version of python you use.