“more” – a CMD command that has been remembered and should not be forgotten

Today is one of those days when I remember the good old days that we did great things even without a mouse, just the hard keyboard and the black terminal, I was trained to configure SNMP, MRTG, <you name it>, with just that. For some reason mouse does not work today, if I do plug any mouse HP KVM goes ballistic. So this afternoon I was stuck in configuring a network adapter thru cmd or the command line. Not hard actually but if you do “IPCONFIG /ALL” on Windows Server 2008 R2 to check, the output will be a looooong list of adapters, as seen in the this screenshot: that’s Adapter # 22 and another isatap. 

Without a mouse, this will be impossible to read, for one it would scroll too fast for the eye – another is that you can’t scroll up. But there’s a way a combination of piping and the more command. A little review for the “younger” admins nowadays.

Piping or | – reads the output from one command and writes it to the input of another command. For redirection commands, you can read thru here: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx?mfr=true

More command – which displays one screen of output at a time. Read thru here: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/more.mspx?mfr=true

This is some of the lessons I got from Mr. D. P. Nava (Hello sir Darth!), is to redirect the output of one command, thru piping, to another command. Then we now get creative, this time, our first command outputs this long strings and redirect (pipe) those output to a command that makes the output only show line per line (more).

To do this, here is a screen capture:

so thats <Command1> <pipe/redirect> <Command2>

or in this particular scenario ipconfig /all | more

Hitting return creates this output:

As you may have noticed, even if the output of the command IPCONFIG /ALL is really long, but it stopped to a point where it can only be displayed by the CMD prompt. To scroll down one line down hit enter again. Hitting SPACE scrolls it to a whole page. Pressing “Q”  quits the more command will return you to your usual CMD prompt.

More command is not just for displaying output of another command, you can use this to read text files etc. The syntax now is More <FileName>. Example:

this has the output of:

Same keyboard shortcuts applies.

Check out the in command help from more by giving it a /? switch

It’s really nice remembering these things when you needed them most!

Advertisements

Published by

johndelizo

I'm John and in the daytime I am the Chief Technology Officer of VFTS.NET - a consulting firm that specializes on development and deployment of business solutions created with .NET framework on Windows platform and Windows infrastructure projects. I am a core member of the Philippine Windows Users Group, a contributor at the Microsoft Philippines Community forums and I regularly conduct technical sessions as well as other Microsoft technology events. I am a Microsoft Most Valuable Professional in the Cloud and Datacenter Management Technical Expertise but away from any keyboard I spend hours reading books, travel, explore, and being busy with my dog named Floppy.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s