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!