Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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?

  2. #2
    Linux Engineer khafa's Avatar
    Join Date
    Apr 2008
    Tokyo, Japan
    what about
    ls [Options] <your_directory_to_list> | less
    Linux and me it's a love story

  3. #3
    Join Date
    May 2004
    arch linux
    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

    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:

    man command_name
    Hope you have fun with it.

  4. $spacer_open
  5. #4
    Thanks for the help guys. It's working great. The links have come
    in handy, too.

  6. #5
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Seattle, WA, USA
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts