fbpx whereis Command in Linux: Find Binary, Sources and Manual | Certificação Linux

whereis Command in Linux: Find Executable, Source Code and Manual

📅 01/01/2019 ⏱ 1 min ✍️ Uira Ribeiro
Linuxcommands
whereis Command in Linux: Find Executable, Source Code and Manual
Exam Pass App — mais de 7.000 questões LPI, offline, em 5 idiomas, disponível no Android e na App Store
Available on
Google Play
Available on
App Store

The whereis command in Linux searches the directories specified in the $PATH and $MANPATH variables for executables, source code, or manuals of a specified word.

Its most common options are:

  • -b: search only for binaries;
  • -m: search only for manuals;
  • -s: search only for source code

Example:

$ whereis ifconfigifconfig: /sbin/ifconfig /usr/share/man/man8/ifconfig.8.gz

The whereis command is useful for showing the full path of commands that are in the directories listed in the PATH variable.

In some situations, when there is more than one version of a program installed, it's good to use whereis to find out which executable the shell invokes.

Another example:

$ whereis phpphp: /usr/bin/php /usr/lib64/php /etc/php.d /etc/php.ini /usr/include/php /usr/share/php /usr/share/man/man1/php.1.gz

Learn much more about Linux in our online course. You can enroll here. If you already have an account, or want to create one, just log in or create your user here.

Liked it? Share

Uira Ribeiro

Prof. Uirá Ribeiro

Chair do Board do Linux Professional Institute

After years of watching professionals waste hours on simple tasks because they didn't know the right Linux tools, I decided to teach.
Today I'm the author of most of LPI's official Learning Materials and mentor to over 14,000 certified students.

See my full story →

That was just one piece. The course teaches the whole path — from your first command to exam day.

Certificação Linux — a plataforma líder em certificações Linux no Brasil
WhatsApp