LinuxQuestions.org
Visit Jeremy's Blog.
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, 05: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, 05:45 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
ls | less
 
Old 07-05-2004, 07: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, 07: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, 08: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, 08:26 AM   #6
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,176
Blog Entries: 4

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

Rep: Reputation: 31
You could try ls -m | less
 
Old 07-06-2004, 03: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, 04: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, 06: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 08:15 AM.
 
Old 04-13-2010, 07:15 AM   #11
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 547

Rep: Reputation: 115Reputation: 115
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


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


All times are GMT -5. The time now is 03:08 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration