Linux - Executable files localization by which command
This note may be useful mostly for Linux beginners. It concerns localization of executable files or links related to a given shell command. This functionality is provided by which program.
How to get a pathname for a given command?
In order to obtain a path leading to an executable file which is linked with given shell command, we need to use which program, as we previously said. It searches all directories defined in environmental variable $PATH trying to match names. It is worth to know that symbolic links will not be followed.
Which in practise
Take a look at a few console outputs, that are showing which command in action. Lets try to find pathnames for GEdit program, and Gnome-Sudoku game:/usr/bin/gedit
/usr/games/gnome-sudoku
/usr/bin/which
Komentarze (0) - Nikt jeszcze nie komentował - bądź pierwszy!