P(1L)

NAME
p - browse or page through files and filter unprintable characters

SYNOPSIS
p [ options ] [ file1 ... filen ]

DESCRIPTION
p reads the files from the argument list and displays them on standard out. If the argument list is empty and standard in is not connected to a terminal, p reads from standard in. After displaying a screen full of text, p stops and displays a MORE ? prompt. If p is reading input from a file and not from a pipe, it displays the percentage of characters already typed together with the MORE prompt.

p interprets non printable characters, such as control characters. Control characters are transformed into the printable character space and preceded by a "^" character. If the eight bit in a character is on and the character appears to unprintable, a tilde "~" character is preceded in addition. Tabs are expanded into spaces as usual on UNIX and lines that exceed the line length of the terminal are wrapped around and continued on the next line of the screen.

OPTIONS
All options can be abbreviated by their first letter.

length=#
    Set the number of lines per page. If no termcap entry could be found length defaults to 24.

width=#
    Set the number of characters per line. If no termcap entry could be found width defaults to 79.

-blank
    Suppress multiple blank lines on the output.

-clear
    Clear the screen before displaying each new page.

-debug
    Print additional debugging information.

-dos
    Hide carriage-return characters that are directly followed by a new-line. As p is binary transparent, reading in files that do not follow DOS newline conventions will not be automatically converted.

-end
    Mark the end of each line with the character '$'.

-help
    Print a short summary of the available options and commands.

-raw
    Do not expand control characters.

-raw8
    Do not expand characters with top bit set.

-silent
    Do not print a MORE ? prompt. Only do the formatting for the content of the files. This option may be used when p is only used as a filter.

-tab
    Do not expand tabs to spaces, expand them to '^I'.

-visible
    Underlining and bold sequences become visible.

-help
    Prints a short summary of the p(1) options and exists.

-version
    Prints the p(1) version number string and exists.

Commands
If a MORE ? prompt is displayed, the following commands are valid:

y,Y,<CR>,<LF>
    Yes. Display the next full screen of text.

h,H Half. Display the next half screen of text.

q,Q Quarter. Display the next quarter screen of text.

l,L Line. Display the next line of text.

1-9 Lines. Dislay the next 1-9 lines of text.

n,N Next/No. Display the next file. If the current file is the last file in the list exit p.

p,P Previous. Display the previous file. If the current file is the first file in the list just start to display the first file.

s,S Stop. Exit the p program.

/pattern
    Search. Start searching for pattern.

r,R Research. Re search for previous pattern.

^L  Redraw. Redisplay the current screen content.

v,V View (Edit). Start the editor in read only mode with cursor position set to the current line.

!   Shell. Execute a shell using the rest of the input line as shell command.

?   Help. Print a short help message that lists valid commands.

other
    Error. All other input will cause a beep if the environment BEEP is not set to off.

If the end of a file is reached, p will start with the next file.

ENVIRONMENT

SHELL
    For the shell to use for shell command escapes, file name globbing and similar.

EDITOR
    The name of the editor (used for the v command).

HOME
    To find the private files like ~/.termcap

TERM
    The type of terminal for which the output should be formatted.

TERMCAP
    This environment variable holds either a precompiled termcap entry or the pathname to be used to find a termcap database file. If it holds a precompiled entry that does not match the TERM environment, the termcap database is parsed as if the TERMCAP environment is not set.

TERMPATH
    If TERMCAP is empty, then the TERMPATH environment is scanned for pathnames of files that contain a termcap database. It holds a list of filenames separated by colons or spaces (i.e., ":" or " "). If the TERMPATH symbol is not set, the files $HOME/.termcap and /etc/termcap are scanned in that order. If a pathname in TERMPATH does not start with a slash ("/"), then the HOME environment is prepended to the name.

BEEP
    The environment variable BEEP is used to suppress beeping when set to off. This helps to use p on a notebook in a meeting.

FILES

/etc/termcap
    The system's terminal capabilities database.

~/.termcap
    The private terminal capabilities database.

NOTES
If you type p with no arguments and do not redirect its standard input, p will display its usage message.

If the terminal driver is configured to strip the eight bit in characters, p will display a tilde character before any character that has the eight bit set (i.e. ~V).

BUGS