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! |
ls | less
|
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? |
try `ls -C | more`
|
Tried that too. Gave me a single column of files that I could scroll down, same as the first command did.
|
Try man ls - that will give you the options/switches to use with 'ls'.
|
You could try ls -m | less
|
Quote:
Code:
ls -C | less 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. |
or you can try
Code:
ls -x | less |
I have the same trouble!
And none of your advices doesn't work... :cry:
UPD: IT WAS ONLY LONG FILE NAMES!!!!!!!!! me lol :newbie: :banghead: :redface: |
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.
|
All times are GMT -5. The time now is 08:18 AM. |