newbie: 'ls' scrolls past top of screen

newbie: 'ls' scrolls past top of screen

Post by Andrew de los Reye » Sun, 18 Jul 1999 04:00:00



i just installed Linux and here's what keeps annoying me: when I type
'ls -l', the output scrolls past the screen. sometimes just 'ls' will
solve the problem, but other times it still scrolls past. Is there any
way to get it to pause between screens or some other solution (I am
reminded of DOS' "dir /p").

Thanks in advance,
Andrew de los Reyes

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

 
 
 

newbie: 'ls' scrolls past top of screen

Post by R.K.A » Sun, 18 Jul 1999 04:00:00



Quote:

> i just installed Linux and here's what keeps annoying me: when I type
> 'ls -l', the output scrolls past the screen. sometimes just 'ls' will
> solve the problem, but other times it still scrolls past. Is there any
> way to get it to pause between screens or some other solution (I am
> reminded of DOS' "dir /p").

ls -la |more

pipe things to "more" to make it fill only a screenful

If you want to read a text-file you can simply "more" it: "more
filename.txt"

K.

 
 
 

newbie: 'ls' scrolls past top of screen

Post by Frederic L. W. Meunie » Sun, 18 Jul 1999 04:00:00



Quote:>...when I type 'ls -l', the output scrolls past the screen. sometimes just 'ls' will
>solve the problem, but other times it still scrolls past. Is there any
>way to get it to pause between screens or some other solution (I am
>reminded of DOS' "dir /p").

Try ls -l | more or just use shift+page up/page down. Or better, type mc
and use Midnight Commander! If you want ls -l, switch using alt+t. Oh, I
can't remember the last time I typed ls.

--
Frederic L. W. Meunier = Niteroi, RJ - Brazil = Tel: +55-21-620-7173


 
 
 

newbie: 'ls' scrolls past top of screen

Post by Jeremi » Sun, 18 Jul 1999 04:00:00





>> i just installed Linux and here's what keeps annoying me: when I type
>> 'ls -l', the output scrolls past the screen. sometimes just 'ls' will
>> solve the problem, but other times it still scrolls past. Is there any
>> way to get it to pause between screens or some other solution (I am
>> reminded of DOS' "dir /p").

> ls -la |more
> pipe things to "more" to make it fill only a screenful

        Or better yet, use 'ls -la | less'.  Some general idea, but
with 'less', you can go back by hitting 'b', and when you hit the end of
the list, it won't terminate (you have to hit 'q' to quit).  The 'more'
solution is more like DOS, but I find the 'less' solution handier.
        Also, you might want to drop the following in your ~/.alias file:

alias lls       'ls -ls | less'

(Oh, and you might need a 'source ~/.alias' line in your ~/.bashrc or
~/.tcshrc to get the aliases to take effect)

Brian

--
email to bmeloon1 at twcny dot rr dot com.   evilquaker is a spam collector

 
 
 

newbie: 'ls' scrolls past top of screen

Post by Glenn Wittroc » Sun, 18 Jul 1999 04:00:00


And once you have a preference for any of the fine commands listed in the
other replies, edit your .bashrc file for handy aliases.  In the root
directory for each user ( and /root for root user) you will find a file
called .bashrc that holds preferences that are loaded when the user logs
in.  I got sick of the huge task of ls -l |more so I added an alias thus
alias lsm='ls -l|more'
then when you type lsm you get the aliased command.  I think today I'll
add an aliias for loctae= 'locate' , my favorite nuisance typo.

Adios  Glenn


Quote:> i just installed Linux and here's what keeps annoying me: when I type
> 'ls -l', the output scrolls past the screen. sometimes just 'ls' will
> solve the problem, but other times it still scrolls past. Is there any
> way to get it to pause between screens or some other solution (I am
> reminded of DOS' "dir /p").

> Thanks in advance,
> Andrew de los Reyes

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

 
 
 

newbie: 'ls' scrolls past top of screen

Post by Paul Anders » Sun, 18 Jul 1999 04:00:00



Quote:>Is there any
>way to get it to pause between screens or some other solution (I am
>reminded of DOS' "dir /p").

Under Linux, you have two options:  
Either scroll back with Shift-PgUp, or use:
ls -l | less
 
 
 

newbie: 'ls' scrolls past top of screen

Post by mike murra » Mon, 19 Jul 1999 04:00:00


use  " ls -l |less"   that is ls minus symbol pipe less Adding the pipe
then less with any command will
get it to you 1 screenful first then you can down arrow or enter for
more
 
 
 

newbie: 'ls' scrolls past top of screen

Post by gen » Fri, 23 Jul 1999 04:00:00




Quote:> And once you have a preference for any of the fine commands listed in the
> other replies, edit your .bashrc file for handy aliases.  In the root
> directory for each user ( and /root for root user) you will find a file
> called .bashrc that holds preferences that are loaded when the user logs

I use tcsh and in my ~/.login:

alias l         "ls -la"
alias ll        "ls -la | less"

These are even simpler.

Less seems to be the better pager because of the ability to scroll forward
and backwards.

--
::::: Gene Imes                      http://www.ozob.net :::::

 
 
 

newbie: 'ls' scrolls past top of screen

Post by Peter Gavi » Tue, 27 Jul 1999 04:00:00





> > And once you have a preference for any of the fine commands listed in the
> > other replies, edit your .bashrc file for handy aliases.  In the root
> > directory for each user ( and /root for root user) you will find a file
> > called .bashrc that holds preferences that are loaded when the user logs

> I use tcsh and in my ~/.login:

> alias l         "ls -la"
> alias ll        "ls -la | less"

> These are even simpler.

> Less seems to be the better pager because of the ability to scroll forward
> and backwards.

> --
> ::::: Gene Imes                      http://www.ozob.net :::::

Even better: If you use bash, try this:

function l() {
  ls -BFal --color $*

Quote:}

function lm() {
  l $* | less -Xr

Quote:}

The -Xr switch on less is necessary to let the color ansi escape codes
pass through w/o confusing less.

Pete

 
 
 

1. 64k files in dir - 'ls' slow but 'strace ls' fast?

        OK, riddle me this...

        I have a directory with 64,000 files in it.  They're all zero-
length regular files in an ext2 filesystem on a SCSI hard drive, nothing
unusual.  But check this:

chindi:/tmp/manyfiles$ time ls
(snip list of file)
real    7m37.655s
user    0m2.640s
sys     6m20.450s

        Ouch!  That's /slow/.  Let's see why it's slow:

chindi:/tmp/manyfiles$ strace -c ls
(snip)
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 85.15    0.321233          50      6400           write
 13.65    0.051490         107       482           getdents
  0.44    0.001653           8       217           brk
(snip)
------ ----------- ----------- --------- --------- ----------------
100.00    0.377256                  7380         2 total

        0.4 SECONDS?!  Something is obviously very different here, but
what?  Amusingly enough, the strace manpage says "A traced process runs
slowly"...

JDW

--
If mail to me bounces, try removing the "+STRING" part.

2. Linux Frequently Asked Questions with Answers (Part 2 of 3)

3. 'ls -e' vs 'ls -l'

4. Problem with locale & raster3d compile

5. 'ls' and AIX 4.3.2 smitty Screen size??

6. useradd problems

7. 'IRQ timeout' message and 'DMA disabled' with 'ls -l'

8. Linux IRC Server?

9. How do I scrow down 'top' output screen?

10. Limiting 'w', 'top' and 'ps'

11. alias ls='ls -a --color=auto'

12. Can't get past 'Expecting OK' - Kppp

13. newbie 'top' question