I want to open the location where python is installed. To check the location I used.
whereis python | xargs -n 1 echo
output :
/usr/bin/python3.8
/usr/bin/python3.8-config
/usr/bin/python
/usr/lib/python2.7
/usr/lib/python3.8
/usr/lib/python3.9
/etc/python3.8
/usr/local/lib/python3.8
/usr/include/python3.8
Although I can copy past the location for xdg but I don't want to do it. I want to use pipe operator and open the location using xdg-open
. However, there is one problem. How do I select the argument from the list above. Suppose I want to select the 3rd location. Is there any way to do it.
I thought of following but it did not work.
whereis python | xargs $3 xdg-open