/ factorpad.com / tech / linux-essentials / whereis-command.html
An ad-free and cookie-free website.
Beginner
Learn to find program binaries and manuals at the Linux command line.
Videos can also be accessed from the Linux Essentials Playlist on YouTube.
Linux whereis Command Summary with Examples (3:57)
Our fourteenth word, or command to memorize is whereis
from the category Help.
whereis
allows you to locate
binaries, manuals and source code.
-options | description |
---|---|
-h |
Print help screen |
-b |
Display path to binaries |
-m |
Display path to user manual pages |
Recall from our last video (tutorial) we talked about gaining our
bearings and whereis
will help us
answer the where
question: where are the important files associated with a command?
Before we start, it helps to think of commands as mini programs and
most follow this structure:
command -option(s) argument(s)
.
The whereis
command has
10 options and the most common argument is the
command in question.
We'll cover the options -h
,
-b
for binaries, and
-m
for manuals, but skip
-s
for downloaded source code
compiled locally.
So why is whereis
an important command?
Well, whereis
helps us find relevant
files easily.
And now you know how to do that.
Okay, the best way to embed this in your memory is by typing in your own terminal window.
Find this on your Mac using a program called Terminal. On Linux use Terminal or Konsole, and currently Microsoft is adding this functionality to Windows.
Here we go, type whereis whereis
.
First, binaries here. See how logical the short abbreviations are? bin for binaries. Next are manual files, and if the source code isn't available, it'll be ignored (as is the case here).
Next, type whereis -h
.
That's a tidy list of options, lowercase
-b
and
-m
are most common. Notice the
-h
option is missing (even though we
just used it).
If this inconsistency bothers you, don't despair. Recall Linux is free and is the work of many contributors. Yes, it's quirky, but just be patient with it.
And let's find the binaries for a few commands we've explored. Try
whereis -s man less type
.
Oh yeah, type is a shell builtin (so help is found in the
bash
command manual).
Last, let's search for manuals for
whoami
,
whatis
and
whereis
.
Okay now you know how to use whereis
.
And you know the syntax for commands, options and arguments.
One last tip about the whereis
command.
If you're curious about Linux search paths, check out the
-l
option. Now that we've seen
whoami
,
whatis
,
whereis
, do you wonder what's next?
Okay, thanks for visiting today. I hope this was a fun introduction
to the whereis
command.
For an overview of the 100 videos, the 8 quizzes, a cheat sheet, the categories and a Q&A section, visit:
Learn faster by combining text with video. Subscribe at YouTube for new content reminders. Twitter @factorpad too.
whoami
command,
hit Back.date
command, click Next.
/ factorpad.com / tech / linux-essentials / whereis-command.html
A newly-updated free resource. Connect and refer a friend today.