Linux.com

Home Linux Community Forums New to Linux Getting Started with Linux Linux command to display files in multiple pages a

Linux command to display files in multiple pages a

Link to this post 14 May 09

I am looking for a simple command to display files in multiple pages at the screen. I tried "ls | more", and it didn't work. Any suggestion?
Thanks.

Link to this post 14 May 09

I want to list the file names at the screen, not the file content.

Link to this post 14 May 09

You can use the -1 option for ls. Like this:

ls -1 | more

Link to this post 14 May 09

what do you mean exactly by "it did not work" ?

ls | more

exactly does what you want. It lists all the files and if there is more than a screenfull, then it waits for you to press a key to show the rest.

ls | less

works better, press the up arrow and you scroll up, down goes down and press the space bar goes to the next contents to fill the whole terminal window

Link to this post 14 May 09

jnvilo wrote:

what do you mean exactly by "it did not work" ?

ls | more

exactly does what you want. It lists all the files and if there is more than a screenfull, then it waits for you to press a key to show the rest.

ls | less

works better, press the up arrow and you scroll up, down goes down and press the space bar goes to the next contents to fill the whole terminal window

When I sent out "ls | more", only the first page was shown. Press "Enter" or "Space" won't move into the next page.

Link to this post 14 May 09

Maybe you run in ls | more in the directory with a few files content, thats why is doesnt need to divide the list on many pages.

try this you will get what you want.

ls /etc | more

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board