Three tips in one, today, for the Command Prompt.
The Help command
In Windows Command Prompt, type Help followed by the enter key. What you’ll see fly by is a list of nearly 100 different commands that can be used in the Command Prompt.
Some are actual stand-alone programs. For example, the second item on the list is something called “ATTRIB”. That corresponds to the program file C:\Windows\system32\attrib.exe. (Command Prompt commands are case insensitive.)
Some are what are called “built in” commands — you won’t find them anywhere on the machine. An example is the first on the list: “ASSOC”. This command is implemented within the Command Prompt itself.
You can get help on individual commands by typing “Help” followed by the name of the command. You can even type “Help Help”.
The More command
The list output generated by Help is much longer than your Command Prompt window, so much of the output was lost as it scrolled past the top. This is a common problem in command line programs, and there’s a simple solution: the “More” program.
“More” displays input one screen at a time, pausing for a key press after each. This way, you can read the contents of one screen and then press a key (I recommend the space bar) to see the next, and so on.
You can exit the program early by pressing the Q key (or Ctrl-Break, in earlier versions of Windows).
The question, then, is how to get the output of the Help command to be the input for the More command.
Piping
Piping is exactly that: taking the output of one program and providing it as input to another. For example, in Command Prompt, type:
Help | More
where “|” is the vertical bar character, often referred to as the “pipe” character. This instructs the first program to “pipe” its output into the second. Now the list provided by Help will be displayed one screen at a time, controlled by More.
Finally, you can get Help on More.
Help More
Note that there is no pipe character in that command: the word “More” was provided as a parameter to the Help command, asking it to display information about the command “More”.
If that’s longer than your window is tall, you can pipe that output into More so you can see it a screen at a time:
Help More | More
In English, that’s running the Help program, asking for help on “More”, and piping that output through the program “More” so as to display one screen full at a time.
This is interesting, certainly. I am not nor have I ever been a programmer (well a bit of Basic on a Sinclair Spectrum way back when until I felt it was beyond me), but I do find knowing there is a Help feature here useful to know.
Very helpful. I never knew how to stop the command screen so I could read all the entries.
I used to use the |more pipe command in older versions of Windows. In more recent versions, the Command Line screen is scrollable and |more piping is not as necessary.
Actually it’s always been scrollable, if you knew what settings to tweak. :-)