How to Scroll Shell Windows??

Status
Not open for further replies.

NewAtOCing

Cadet
Joined
Mar 31, 2012
Messages
8
I know, I know... a total noob question, but I can't figure out for the life of me how to scroll through the results of the shell window.

I got several checksum errors and did a smartctl -a, but the results are way to long to read without having someway to scroll. I have tried up/down arrows, page up/down, +/-, and using scroll lock, shift, and alt with all combinations of the previously mentioned keys.

If there is not a way, is it possible to output the results with spacing/formatting? I also tried smartctl -a /dev/ada1 > /mnt/MediaDrive/test.txt, but that is un-formatted and extremely hard to read. Also, e-mail is not an option.

Thanks!
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
UNIX blesses us with the miracle of pipes. Not the crappy imitation provided by MS-DOS, but the real thing. You can take one command and run it through another.

"smartctl -a | more"

This is probably the best way to go. However, FreeBSD's console also has a scrollback function. It's just a little hidden, because you don't want the console intercepting stuff that a program might do. Hit "scroll lock", at which point your cursor should change (or vanish or something, don't recall). Then page up/page down (or cursor up/down for line-at-a-time). The downside: the scrollback is only 200 lines by default. You can bump it up with "vidcontrol -h <number>"
 

Stephens

Patron
Joined
Jun 19, 2012
Messages
496
This is a question, not a challenge, but what makes MS-DOS's piping a crappy imitation of *NIX's? As far as I know, more works the same with MS-DOS. BTW, *nix noob that I am, I've all but replaced "more" usage with "less".
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
MS-DOS does it with temporary files, which imposes a lot of constraints on how it works, not the least of which is that a command has to complete before output can be paged, and output length is restricted based on things like available disk space.

*nix noob that you are ( :) ) I'm kind of curious how and why you would replace "more" with "less." FreeBSD, I think both Net and OpenBSD, and many Linux distributions provide "less" as the system version of "more." Try "more --version" on your FreeNAS... there was certainly plenty of incentive back when FreeBSD's pager was based on 4.4BSD-Lite to want a more sophisticated pager, but "less" has been part of the system for quite some time (FreeBSD 4 I'm pretty sure).
 

Stephens

Patron
Joined
Jun 19, 2012
Messages
496
I started using less instead of more because to me, more only had a few options: a key to move down another line, a key to move down another page, and a way to exit/abort. I never even tried using page up and page down (it doesn't work under Windows). I read somewhere about less and never looked back. I've executed your command ("more --version") and I see your point. I also tried page up and page down, which of course both worked.

I'd "forgotten" about the things you reference with MS-DOS/Windows MORE. Those restrictions just became part of the landscape since I learned of them so long ago. But now that you mention it, I can remember the first "WTF?!" moment when I tried to do "DIR | MORE" when I'd booted from a write-protected floppy disk.
 

NewAtOCing

Cadet
Joined
Mar 31, 2012
Messages
8
Oh man, that was simple. Thanks!

Looks like I have some checksum errors on my ZRAID arrary :( At least I know how to look at them now.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I started using less instead of more because to me, more only had a few options: a key to move down another line, a key to move down another page, and a way to exit/abort. I never even tried using page up and page down (it doesn't work under Windows). I read somewhere about less and never looked back. I've executed your command ("more --version") and I see your point. I also tried page up and page down, which of course both worked.

Right, well, again, poor imitations at best. In all fairness, "less" was written because the original UNIX "more" utility was relatively feature-sparse; there was a tendency in the early days for utilities to be small, fast, terse, and did I say small? When a "large" memory system might have 4MB of memory, and a small system would have 256-512KB, and disk drives were slow sluggish beasts, you couldn't really create huge piggy programs that would be slowing the system down on a constant basis. It was kind of rude on a multiuser system to be using excessive resources.

The irony, at least to me, is that modern systems are capable of SO MUCH STUFF but as an old-timer I have a tendency to do things the same way I was doing them 20 or more years ago. Benefit: everything supports the stuff I try to do (think, for example, the number of vi clones). Downside? I could probably be 10% more productive if I could be bothered to learn new tricks.

I'd "forgotten" about the things you reference with MS-DOS/Windows MORE. Those restrictions just became part of the landscape since I learned of them so long ago. But now that you mention it, I can remember the first "WTF?!" moment when I tried to do "DIR | MORE" when I'd booted from a write-protected floppy disk.

Imagine my horror and annoyance, having come from a UNIX background where this sort of stuff worked right even on little machines.
 
Status
Not open for further replies.
Top