MC, 12:45 czwartek, 25.06.2015 r.
Ilustracja do artykułu: Linux - Executable files localization by which command

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:
$ which gedit
/usr/bin/gedit
$ which gnome-sudoku
/usr/games/gnome-sudoku
And maybe... ;)
$ which which
/usr/bin/which

Komentarze (0) - Nikt jeszcze nie komentował - bądź pierwszy!

Imię:
Treść:
Polish version: which Linux - Jak znaleźć ścieżkę do programu?