LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-20-2003, 01:33 PM   #1
acumen15
LQ Newbie
 
Registered: Aug 2003
Posts: 4

Rep: Reputation: 0
Thumbs down 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.
 
Old 08-20-2003, 01:50 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Welcome to LQ.

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

Then you can scroll with the arrow keys.
 
1 members found this post helpful.
Old 08-20-2003, 02:15 PM   #3
acumen15
LQ Newbie
 
Registered: Aug 2003
Posts: 4

Original Poster
Rep: Reputation: 0
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.
 
Old 08-20-2003, 02:27 PM   #4
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 45
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/
 
Old 08-20-2003, 02:29 PM   #5
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
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.
 
Old 08-20-2003, 09:39 PM   #6
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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.
 
Old 08-21-2003, 03:09 AM   #7
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
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.
 
Old 08-21-2003, 03:18 AM   #8
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 46
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!
 
Old 08-21-2003, 08:01 AM   #9
acumen15
LQ Newbie
 
Registered: Aug 2003
Posts: 4

Original Poster
Rep: Reputation: 0
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.
 
Old 08-21-2003, 08:09 AM   #10
acumen15
LQ Newbie
 
Registered: Aug 2003
Posts: 4

Original Poster
Rep: Reputation: 0
just to clear that up I mean linux and unix being different from microsoft.
 
Old 08-21-2003, 01:35 PM   #11
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
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'
 
Old 08-23-2003, 03:37 PM   #12
zsejk
Member
 
Registered: Apr 2003
Distribution: Slackware
Posts: 345
Blog Entries: 5

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



-zsejk
 
Old 01-29-2010, 03:25 PM   #13
jenaniston
LQ Newbie
 
Registered: Jan 2010
Location: Malibu, California
Distribution: Fedora 13 KDE
Posts: 16

Rep: Reputation: 0
Quote:
Originally Posted by david_ross View Post
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.

Last edited by jenaniston; 01-29-2010 at 03:54 PM.
 
Old 08-04-2013, 07:57 AM   #14
ToothlessPenguin
LQ Newbie
 
Registered: May 2013
Location: nomad
Posts: 6
Blog Entries: 1

Rep: Reputation: Disabled
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?

Last edited by ToothlessPenguin; 08-04-2013 at 08:06 AM. Reason: found the way
 
Old 08-05-2013, 04:01 AM   #15
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,280

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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/
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
please...how to pause scrolling messages at boot lerningkurv Linux - Newbie 5 05-15-2005 07:24 PM
screen garbage when scrolling in X-Windows ClayOgre Linux - General 0 05-02-2004 06:52 PM
screen scrolling? stateq2 Debian 3 06-26-2003 03:44 PM
Screen resolution & Scrolling moose Linux - Hardware 1 05-24-2003 02:26 AM
Vitual Desktops/Screen Scrolling JereBear Linux - Newbie 1 04-21-2001 09:30 PM


All times are GMT -5. The time now is 01:51 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration