Windows

Increase your Command Prompt scrolling capability in Windows XP Pro with the List command


The More command on the Command Prompt in Windows XP Pro (go to Biglogfile.txt | More) allows you to view a very long text file one screen at a time. With the More command, it's easy to overshoot the information you need due to the overwhelming amount of data you may scroll through. When that happens, you have to cancel the operation and start over. The More command only allows you to scroll down through a file.

A command line tool called List allows you to scroll both up and down through a file. List is not found in Windows XP; it’s a part of the Windows Server 2003 Resource Kit Tools.

Because the Windows Server 2003 Resource Kit Tools also work in Windows XP, you can use the List command on your system. Here's how:

  1. Download Windows Server 2003 Resource Kit Tools.
  2. Double-click the RKTools.exe self-installer and follow the onscreen instructions.
  3. Once you have the Windows Server 2003 Resource Kit Tools installed, you can use the List command at the Command Prompt by typing List followed by the name of the file that you want to scroll through. For example, you can scroll through a big log file using the List command List Biglogfile.txt.
  4. The Command Prompt window will change into a file viewer and display contents of the file. Use the arrow keys as well as the [Page Up] and [Page Down] keys to scroll through the file.
  5. To exit List, type Q or press [Esc].

Note: This tip applies only to Windows XP Professional.

Miss a Windows XP tip?

Check out the Windows XP archive, and get more hands-on Windows XP tips.

Stay on top of the latest XP tips and tricks with our free Windows XP newsletter, delivered each Thursday. Automatically sign up today!

About

Greg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry.

16 comments
CharlieSpencer
CharlieSpencer

Does anybody remember the trick to adding "Open Command Prompt Here" to the right-click menu? There's a way to add "Command Prompt" to the right-click menu, right-click a folder in Windows Explorer / File Manager, and get a command prompt window that opens in the same directory you had open in Explorer.

ganymede28211
ganymede28211

OMG. A Command prompt MORE utility replacement... There's only a 100 ways in Windows to view a text file. If the file is reasonably small, under a few meg.. Just type NOTEPAD . Scroll all you want... Why use the command utilities? And MORE is no big deal.. More has been mimicked a 1000 times at least with more ability. LETS NOT FORGET that MORE has been around for FOREVER. I remember using MORE as far back as DOS 2.11. Can't we get a REAL article on USEFUL utilities?

Mond0
Mond0

HotDos? You could scroll backwards with it! No more MORE (ha!) But, who needs this stuff when XP has a scroll bar in the "DOS" window? How about DosKey? It's still part of the underlying OS in Windows XP and still a very useful utility!

TheGooch1
TheGooch1

If I just want to read 1-2 lines from a 500MB+ text file, is there a tool that run on Windows XP to do that? Right now I use Textpad to open the entire file, and my system slows to a crawl in the meantime.

tim.mcgovern
tim.mcgovern

... the *nix "less" command which you can get as part of the "unxutils" bundle along with a raft of other tools to beef up the xp commandline. You can also alter the properties of your command window to increase your scroll buffer so you don't lose lines which go off the top of your window. I often set mine to 3000 lines or so with no impact on performance.

carole.turner
carole.turner

Both More and List are DOS commands. More is also used in Unix and Linux. Windows is a bit raw taking the credit!

wilmoore
wilmoore

>...read 1-2 lines from a 500MB+ text file >...a tool that run on Windows XP @John, 1 - Visit, http://gnuwin32.sf.net or go straight to the Coreutils download page @ http://gnuwin32.sf.net/packages/coreutils.htm 2 - I suggest you download the package labeled "Complete package, except sources". 3 - Install 4 - Open a command shell (cmd.exe) 5 - type the following: head Filename.txt The above command will by default give you the first ten lines of your file. To view just the first two lines type: head -2 Filename.txt If you want the last two line type: tail -2 Filename.txt There are a bunch of useful utilities included in the Coreutils package. I hope this helps.

TheGooch1
TheGooch1

I am not looking to search, just to retrieve a certain number of lines from a gigantic text file without having to first load the entire document into memory. Usually I do this for a file that contains data, but I don't know the data format, so I want a small sample of the contents to help me decipher the format. Thx.

911
911

This is trivial in UNIX. It's called GREP (and such variants as egrep, fgrep, zgrep, zegrep, zfgrep, zipgrep ). There are many downloadable sets of UNIX tools which have been ported to DOS/Win. A quick Google search will overwhelm you with choices of tool sets. I recommend http://gnuwin32.sourceforge.net/packages.html From there, review all of the tools and you'll learn about what MS never got around to providing. More specifically, GREP and SGREP are what you need.

dippleydokus
dippleydokus

I don't know about an XP utility, but one of the best $25 I ever spent was for "Search and Replace 32" from funduc software. Have it search for what you want in any file, files or folder structure (and replace if you like). Or ZTree (remember the old Xtree?) which is great for any kind of file management.

doug.lewis
doug.lewis

This is a great addition to the toolset for windows but I still prefer the *nix "LESS" command over this one.

Chris910
Chris910

--open the command window --right click the bar at the top (I forgot it's proper name) --Select properties --Select the layout tab --Set the Screen Buffer Size to the number of lines you expect in your file or more -- then say OK and select to save the change just for this window --Scroll up or down to your hearts desire.

FXEF
FXEF

You're right Doug, "less is more". I also use the "cat" and "grep" commands with my text file viewing. Ain't Tux a great friend!

Editor's Picks