Results 1 to 5 of 5
I know this is probably a dumb question, but since I'm
new to the Linux OS, and especially to using the Linux
command prompt, most likely this will be an ...
- 12-17-2008 #1Just Joined!
- Join Date
- Dec 2008
- Posts
- 5
Pausing the ls command
I know this is probably a dumb question, but since I'm
new to the Linux OS, and especially to using the Linux
command prompt, most likely this will be an easy one.
I'm a long time MS user and since I've used it since DOS 5,
I'd rather use the shell to run things, plus it gives you
more control over them.
Since I'm wanting to move to using Linux as my main OS,
I'm trying to find the equivalent to the more common
shell commands that I use. One that I'm having a problem
finding is the option for the list command 'ls' to
pause the screen after each page, the way 'dir /p' would
do in DOS. Can anyone help?
- 12-17-2008 #2
what about
Code:ls [Options] <your_directory_to_list> | less
Linux and me it's a love story
- 12-17-2008 #3forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,091
Welcome to the forums!

The command given above by khafa should work for you.
For more information on Linux commands and working with the command line under Linux, check out LinuxCommand.org.
Below is a free online book that you can look through for additional commands:
Linux Command Directory: Index
Another option for additional information regarding commands is:
Hope you have fun with it.Code:man command_name
oz
→ new members/users: read this first | new member faq
→ no private messages requesting computer support - post them on the forums!
→ please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.
- 12-18-2008 #4Just Joined!
- Join Date
- Dec 2008
- Posts
- 5
Thanks for the help guys. It's working great. The links have come
in handy, too.
- 12-18-2008 #5
I want to clarify one other thing.
In the Linux shell, as I'm sure you will learn, we do a lot of work by taking the output of one command and using it as the input to a second command. This is called piping, and allows you to perform complex behaviours very simply. It also allows commands to focus on doing one thing well, because it is very easy to interweave them.
khafa's command is an example of this. "ls" lists files, and "less" (successor to an older command called "more") is a pager that reads input and allows you to navigate up and down and search for words.
So what has been done here is piping the output of ls into less. However, unlike dir /p, you can pipe anything into less. So if you're compiling a program and want to see all of the output, you can do "gcc ... | less". Or if you just want to read a file more easily than printing the whole thing at once, you can just do "less /path/to/file".
Best of luck in learning more about the Linux shell. It's a very powerful tool.DISTRO=Arch
Registered Linux User #388732


Reply With Quote
