• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

halting text in linux..

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

e_storm

Member
Joined
Mar 16, 2001
Location
Chicago, IL
I am running a command in linux "cat cpuinfo"

Now, I am running this at runlevel 3 and I have a dually computer...so when it displays the cpu information, I can only see the info on the second cpu because the info from the first cpu is up above the screen.

Is there a switch I can use to keep the text on the screen from page to page so I can actually see it before I flys by?

mandrake 9.0 run level 3


thanks guys :)
 
I would just pipe the output into a "pager": a program designed to do the thing you want.

Examples:

cat /proc/cpuinfo | more
(press enter to scroll)
cat /proc/cpuinfo | less
(press enter to scroll and q to exit)
 
You could also send the information to a file.

cat /proc/cpuinfo > cpuinfo.txt

If you want to append the information to a file.

cat /proc/cpuinfo >> cpuinfo.txt

Of course there's more you can do, but the commands you see open up lots of options.
 
cool, thanks guys...

I gotta say, so far I'm liking Linux a lot... very time consuming to relearn thing, but there seems to be so much control over the OS... I'm liking that part.
 
Actually you don't even need to pipe the text through less, just type less file and it will halt the text for you. I can't remember off hand, but I think that more works just the same.
 
Yep, both more and less work the way moorcito said. Learn something new everyday :)
 
Yes, if all you're doing is outputting information to the screen. More and Less work just fine.

Grep is another command you'd probably be interested in.

Try it out.

grep cpu /proc/cpuinfo
grep "cpu MHz" /proc/cpuinfo

cat /proc/cpuinfo >> /home/foo/cpuinfo.txt | grep "cpu MHz" /home/foo/cpuinfo.txt

or

cat /proc/cpuinfo >> /home/foo/cpuinfo.txt && cd /home/foo && grep "cpu MHz" cpuinfo.txt >> cpumhz.txt

I know alot of this seems redundant, but this is really just an intro. There's some really great stuff you can do with different commands. Like using sed to scan through a file and add or remove text. The possibilities really just seem to go on and on. Eventually you'll find that it's preferable to start writing your own shell scripts. That's when you'll really begin to tap the power of linux.
 
more < less

That's just some linux guy humor for ya... Less offers more than more.
 
Back