sudo is a frontend program that takes arguments, switches and commands. Most commands can take arguments & switches, but some can take other commands to run. Think of them as wrappers if you will.
sudo will create an entirely new instance of Bash (with elevated privileges as root), and then run the command you provided it.
So in this case
sudo is running the program
pip3 + all the arguments that occur after it. Those arguments, are for
pip3, not for
sudo. NOTE: keep in mind this template when you see
$ sudo <switches> "<command> <command's arguments + switches>"
So then what's pip3?
The commands themsevles are often a wealth of information when you're unsure what they do. Most will provide you a short synopsis of how to use them and what they do if you run them with a
--help switch. This can vary, sometimes it's
-help or even
I don't have
pip3 installed, but I do have
pip2. They are in fact the same tool, but
pip3 is a newer version.
$ pip2 --help
pip <command> [options]
install Install packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
search Search PyPI for packages.
zip Zip individual packages.
unzip Unzip individual packages.
bundle Create pybundles.
help Show help for commands.
-h, --help Show help.
-v, --verbose Give more output. Option is additive, and can be used up to 3 times.
-V, --version Show version and exit.
-q, --quiet Give less output.
--log <file> Log file where a complete (maximum verbosity) record will be kept.
--proxy <proxy> Specify a proxy in the form [user:passwd@]proxy.server:port.
--timeout <sec> Set the socket timeout (default 15 seconds).
--exists-action <action> Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup.
--cert <path> Path to alternate CA bundle.
--help shows us what this tool can take in terms of commands and switches, but doesn't tell us what it does. Let's see where it's located. For this you can use the
$ type -a pip2
pip2 is /usr/bin/pip2
pip2 is /bin/pip2
Notice that it's in
/bin. So that would indicate that our package manager installed this tool. On a Red Hat based distro you could use
rpm to find out what package this executable,
pip2, belongs to.
$ rpm -qf /bin/pip2
file /bin/pip2 is not owned by any package
Interesting, so this executable isn't being managed as part of my system's package management tool,
So now what?
Well we're far from dead. Let's see if the system can give us any additional hints as to what installed
Most Linux distros ship with
mlocate, a tool that periodically builds an index of all the files that are on the hard disk. So we can search for
pip2 to get hints of other locations of places where pieces of it may be lurking.
$ locate pip2
So we know there's 2 versions installed, 2 and 2.7. But that didn't help a lot, so let's cast the net a bit wider and look for just
pip. Also we're going to filter the results a bit and only get results that end with
pip. We'll use
grep to do this bit.
$ locate pip | grep 'pip$'
Finally! Some useful information.
pip2 is a tool used by our installation of Python. So if we go to Google and look up "pip python":
pip2 is a package manager for Python.
So that command is installing a
.whl file for our Python installation.