s science fiction writer Neal Stephenson wrote, "In the beginning was the command line
." Before the web and graphical user interfaces (GUIs), computer operators used the lowly command line to control their computers. As antiquated as the command line is, you can still find it in any major, modern operating system. The DOS shell survived intact within early versions of Windows, and its descendant, the Command Prompt, exists in even the latest versions of Windows. And the venerable Unix shells live on in GNU/Linux and other Unix variants, including Mac OSX.
You can use the command line described in this article in many ways. It can be a, quick shortcut on your homepage, enabling a web search with just a few keystrokes. Or, it can be a part of a larger system, allowing access to features that don't have a graphical interfaceor at least, don't have one yet.
Trying It Out
First, let's take a look at the command line (see Figure 1). If you want to try it out yourself with source code, simply unpack the code download and direct your browser to the "index.html" file. This will, in turn, load "bcl.js", which contains the implementation of the command line. You can also extract the form HTML from "index.html" and add it to your own web page. Just make sure that the <script> tag (which loads "bcl.js") is loading it from the correct directory.
One of the example commands is g, which does a Google search. Figure 2 shows using the command g command line for the phrase "command line."
When you press Return, the command line sends you to Google, searching for "command line". Figure 3 shows the results.
You can also go directly to image search, using the command line g i command line.
Now, take a look inside the code to see how it works.