If you are working at the Linux shell, then every now and then it will happen that the output a command-line gives you is more extensive than the amount of data your terminal-window can display.
If this happens, the output not fitting into the terminal anymore simply scrolls out at the top and is not visible anymore.
But what if this is the output you’re interested in?
Of course you can have a look at the scrollbars your terminal window may give you. (perhaps you’ve opened a graphical terminal window or you are connected via putty)
Then take the mouse and simply scroll up.
But wait! What if the terminal doesn’t give you a scrollbar?
What if you are accessing the Linux system from the “real” console, for instance within your virtualization environment VMware vSphere or Hyper-V?
Aaand … don’t the cool guys always try hard to avoid using the mouse? ;-)
Well - because I know you are one of these cool guys, I have three ways for you to handle massive text-output at the command-line
The statement “everything is a file” is a kind of Unix/Linux-philosophy.
The idea here is the following:
No matter what you wanna accomplish on a system - everything you need for getting the job done are tools to work somehow with files.
Print them out, modify them, copy them, move them … you name it.
Well - that doesn’t apply to really everything. But as you are working more and more on Linux systems, you will recognize this pattern again and again.
No - I don’t have any empirical data for this. But …
if I should name the top 5 frustrations of Linux beginners, then the “command-not-found” errors would be most certainly on this list.
Especially if you are new to the Linux command line, it’s not always obvious what is causing this error.
First: You simply don’t know all the tools
As you start exploring the Linux command line (aka “the Linux shell”), you simply don’t yet know the tools that are available there.
There are a load of them and unfortunately not every tool is available on every Linux distribution. And don’t worry - you will get to know them step-by-step once you proceed through your Linux journey.
(I’ll show you a shortcut for getting all the really essential tools later on - but that’s _not_ the point of this post at all)
The point here is …
The shell searches in it’s own way …
To understand (and really overcome) these “command not found” errors, we need to understand what causes them, don’t we?
So let’s face the challenge and let’s have a look how the shell searches for a command to run.