LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I want to pause the screen from scrolling (http://www.linuxquestions.org/questions/linux-newbie-8/i-want-to-pause-the-screen-from-scrolling-83891/)

acumen15 08-20-2003 01:33 PM

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.

david_ross 08-20-2003 01:50 PM

Welcome to LQ.

Try piping your ls command into less. eg:
ls -la | less

Then you can scroll with the arrow keys.

acumen15 08-20-2003 02:15 PM

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.

darthtux 08-20-2003 02:27 PM

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/

trickykid 08-20-2003 02:29 PM

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.

jschiwal 08-20-2003 09:39 PM

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.

david_ross 08-21-2003 03:09 AM

Quote:

Originally posted by trickykid
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.

Cool - I hadn't thoguht of puting variables in an alias. Here is the code:
alias long='ls -la $1 | less'

Then just type "long" at the bash prompt.

Azmeen 08-21-2003 03:18 AM

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!

acumen15 08-21-2003 08:01 AM

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.

acumen15 08-21-2003 08:09 AM

just to clear that up I mean linux and unix being different from microsoft.

david_ross 08-21-2003 01:35 PM

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'

zsejk 08-23-2003 03:37 PM

Did I mention yet how nice a book Sam's "Teach yourself Unix in 24 Hours" by Dave Taylor is?

;)

-zsejk

jenaniston 01-29-2010 03:25 PM

Quote:

Originally Posted by david_ross (Post 434075)
Welcome to LQ.

Try piping your ls command into less. eg:
ls -la | less

Then you can scroll with the arrow keys.

Code:

ls -la | less
Works perfect!
I 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.

ToothlessPenguin 08-04-2013 07:57 AM

END
 
When I use the

ls -la!less command
it did as you said (Great!) but at the end of the directory was the word END printed.

I couldnt get back to the command prompt.
So, how to get back to the command prompt?

(sry i found it. type q Q :Q ZZ)

Maybe someone could comment a little on what the "less" parameter does? What it is? Are there other words to follow the "|" (***not the letter l, but the vertical line***) character which modify a command? If so is there a list of them?

chrism01 08-05-2013 04:01 AM

Short answer; the pipe '|' allows you to pipe (or chain) multiple cmds so that, as mentioned above, you can use almost any of the basic cmds to filter the output of one cmd through another and so on.
As above, *nix offers many simple cmds that you can use to build your own toolbox, rather forcing complex standalone cmds on you that you can't pipe.
'less' is a cmd, as is 'more', and there are many others.
See the clever tricks in some answers here for pulling substrings etc out of records using eg cat, sed, cut, awk....

Read/absorb this http://rute.2038bug.com/index.html.gz and bookmark this to check each cmd/option http://linux.die.net/man/


All times are GMT -5. The time now is 09:00 AM.