LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-05-2004, 04:42 PM   #1
jhecht
Member
 
Registered: May 2004
Location: NYC
Distribution: Puppy Linux - it's dog-gone great!
Posts: 99

Rep: Reputation: 16
How to paginate in the 'LS' command?


Ok - newbie here... But I can't seem to find any way to make the 'ls' command do a 'paginate' function. Like doing 'dir /p' in DOS. It's a way of viewing a large bunch of files a page (screen) at a time.

I know there's GOTTA be a way to do this - but I can't find it! I'm working from the Linux commandline to copy some files to floppy from the /etc folder. There are LOTS of files in /etc...

Why am I doing this? Because there's a problem with copying files to floppy from inside any GUI on my Linux box. I can only copy to floppy at the CLI right now. See my other posts for the details.

Thanks!
 
Old 07-05-2004, 04:45 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
ls | less
 
Old 07-05-2004, 06:25 PM   #3
jhecht
Member
 
Registered: May 2004
Location: NYC
Distribution: Puppy Linux - it's dog-gone great!
Posts: 99

Original Poster
Rep: Reputation: 16
Uh, close. 'ls | less' gives a 1 line at a time display in a single column. Better than nothing.

But what I want is a multiple column display, that scrolls one screen at a time. Is that possible?
 
Old 07-05-2004, 06:38 PM   #4
xamdbz01
Member
 
Registered: Jun 2004
Location: Colorado Springs, CO
Distribution: FC2
Posts: 33

Rep: Reputation: 15
try `ls -C | more`
 
Old 07-06-2004, 07:23 AM   #5
jhecht
Member
 
Registered: May 2004
Location: NYC
Distribution: Puppy Linux - it's dog-gone great!
Posts: 99

Original Poster
Rep: Reputation: 16
Tried that too. Gave me a single column of files that I could scroll down, same as the first command did.
 
Old 07-06-2004, 07:26 AM   #6
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Try man ls - that will give you the options/switches to use with 'ls'.
 
Old 07-06-2004, 02:13 PM   #7
camelrider
Member
 
Registered: Apr 2003
Location: Juneau, Alaska
Posts: 251

Rep: Reputation: 32
You could try ls -m | less
 
Old 07-06-2004, 02:30 PM   #8
comp12345
Member
 
Registered: Feb 2004
Posts: 467

Rep: Reputation: 30
Quote:
Originally posted by jhecht
Uh, close. 'ls | less' gives a 1 line at a time display in a single column. Better than nothing.

But what I want is a multiple column display, that scrolls one screen at a time. Is that possible?
I don't understand what's wrong with the choices being given to you. 'ls | less' works just like 'dir /p'. For multiple columns, use
Code:
ls -C | less
Use:

spacebar or pagedown - to scroll down one screen
pageup - to scroll up one screen
arrow keys - to move up and down the screen

'man less' for others.
 
Old 07-06-2004, 03:26 PM   #9
xamdbz01
Member
 
Registered: Jun 2004
Location: Colorado Springs, CO
Distribution: FC2
Posts: 33

Rep: Reputation: 15
or you can try
Code:
ls -x | less
 
Old 04-13-2010, 05:16 AM   #10
MaXM00D
LQ Newbie
 
Registered: Apr 2009
Posts: 1

Rep: Reputation: 0
Exclamation I have the same trouble!

And none of your advices doesn't work...


UPD: IT WAS ONLY LONG FILE NAMES!!!!!!!!! me lol

Last edited by MaXM00D; 04-13-2010 at 07:15 AM.
 
Old 04-13-2010, 06:15 AM   #11
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

Rep: Reputation: 120Reputation: 120
The output from ls is slightly odd and it seems to depend on the number of files as to how it's treated. If you do ls -C in a large directory you may see multi-column output then you do ls -C > out.txt and it will be line by line. This is on AIX 5.1.
 
  


Reply

Tags
possible, solution



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
Any arguement that can be used with 'ls' command to ignore case? davidas Linux - Newbie 5 02-26-2006 04:46 AM
alias cs='cd $1; ls' milanche Linux - Newbie 11 09-13-2005 05:57 PM
'ls' command... sramelyk Slackware 7 10-01-2003 12:45 PM
general 'ls' question purpleburple Linux - General 8 04-17-2003 12:21 PM
creation date of file using the 'ls' command robt Linux - Newbie 1 03-27-2003 12:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:44 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration