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

    Show a Single Page and then Quit

    Is there a command to show one page of text? I want something like less or more, but automatically quits after displaying a single page.

  2. #2
    You could use cat with the file name then pipe head or tail with a -n and the number of lines to display. example cat /etc/hosts.deny | -n50.

  3. #3
    why not just run head on it's own?

    [you@yourbox]$ head -n 50 /path/to/file

  4. $spacer_open
  5. #4
    Just Joined!
    Join Date
    Jul 2006
    Better yet, use the actual page size:
    head -n $LINES /path/to/file
    In some cases the $LINES variable is broken, as seen in this article bash - LINES and COLUMNS environmental variables lost in a script - Stack Overflow , in which case you need to replace "$LINES" with "$(tput lines)" (credits to Puppe in the link above).

  6. #5
    The tput command is not available on my system. Is there another way to get the actual page size?

    tput: command not found

Posting Permissions

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