![]() |
I want to pause the screen from scrolling
OK. I really did not want to make a post but I could not take it any more. I know this has to be a dumb question and am probably going to get crap for it but I can not find out how to do this anywhere. I list something in a directory and my terminal scrolls down so I can not see what is above it. I know I can Pause the text with the [scroll lock] key but it scrolls too fast and I still can't catch the first part of the list. I also found out that I can scroll the terminal up by holding down [shift] and pressing [Page up] key but It doesn't go up far enough. I still can not see the top of the list. I thought maybe there would be a switch or something for the ls command that would pause the list like you can do with the dir command in DOS but I haven't seen it in the man pages. What am I missing here. The directory is huge and i just want to see the hole thing.
|
Welcome to LQ.
Try piping your ls command into less. eg: ls -la | less Then you can scroll with the arrow keys. |
There has to be an easier way than a work around like that right. I mean I just want to view the contents of a huge directory from a command line. It can't be more difficult than using a command to view it one page at a time can it. thanks for your help.
|
In Linux and Unix the philosophy has been when making a command, that it is to do one job and to do it right. So as far as the command-line, no, there's not an easier way to do it. Pipes and redirection are an itegral part of the Unix/Linux world.
If you want to do it with a GUI, KDE and GNOME have good file managers or check out the Gentoo File Manager http://www.obsession.se/gentoo/ |
Make an alias of that command given by david_ross so you don't have to type that huge long string then.. ;)
AFAIK though, there isn't a command already that does that, most would just either type it out or make an alias I would assume. |
If you are in KDE and have a wheel mouse, you can use the wheel to scroll the screen.
Piping through the less command allows you search for text. Just type a slash '/' and the text you are looking for. Repeat the search by typing '/' by itself again. |
Quote:
alias long='ls -la $1 | less' Then just type "long" at the bash prompt. |
Guys... he did say one page at a time...
try this: ls | more or if you want more details then ls -al | more... more works the same as in Win/DOS. But us Linux users prefer less because of the ability to scroll up as well as down. Cheers! |
Thanx to all. I was not aware that linux and unix was so different. I really was not expecting such a hard time learning this OS. I had no idea that you could pipe a command to another command to get more funtionality. You all were a great help.
|
just to clear that up I mean linux and unix being different from microsoft.
|
Just as an update to my earlier post I found that it can be annoying if the dir doesn't fill the whole screen and just sits in less. Hence a different alias:
Code:
alias list='NUM=`ls -la $1|grep -c ""`;TOT=`stty size|cut -d" " -f1`;if [ $NUM -lt $TOT ];then ls -la $1;else ls -la $1|less;fi' |
Did I mention yet how nice a book Sam's "Teach yourself Unix in 24 Hours" by Dave Taylor is?
;) -zsejk |
Quote:
Code:
ls -la | lessI only have root terminal on a sick laptop . . .so . . . Thank you very much. I am running a Sharp AL27 laptop just off of a "jerry-rig" USB OS (Ubuntu 9.04) (live versions won't map to hard drive - incomplete boot). The USB OS was made on a Dell campus computer, but I got amazingly lucky . . . I can at least get that root terminal on the laptop for file rescue mission off of the unbootable hard drive OS (Windows XP). Anyhoo . . . my entire laptop screen after a PXE LAN boot to this USB OS is only the root terminal . . . basic black with white font. I sure hope this forum doesn't mind too much about some other terminal commands I may ask about (only when I'm really stuck). Thanks. |
| All times are GMT -5. The time now is 05:49 PM. |