From paul@uiucuxc.CSO.UIUC.EDU Mon Aug 25 21:59:25 1986 Received: by mirror.TMC.COM (4.12/UUCP-Project/rel-1.0/08-20-86) id AA26071; Mon, 25 Aug 86 21:59:07 edt Received: from uiucdcs.UUCP by seismo.CSS.GOV with UUCP; Mon, 25 Aug 86 16:29:56 EDT Received: from uiucuxc.CSO.UIUC.EDU (uxc.cso.uiuc.edu) by a.cs.uiuc.edu with SMTP (UIUC-5.44/9.6), id AA26177; Mon, 25 Aug 86 15:26:21 CDT Received: from localhost by uiucuxc.CSO.UIUC.EDU (4.12/9.4), id AA07748; Mon, 25 Aug 86 15:22:51 cdt Message-Id: <8608252022.AA07748@uiucuxc.CSO.UIUC.EDU> To: sources-request@mirror.ARPA Cc: casey@csustan.ARPA Subject: Revised man page for less Date: 25 Aug 86 15:22:48 CDT (Mon) From: Paul Pomes (CSO, UofI, Urbana, IL 217-333-6262) Status: R I converted the man page to use the .B, .I man macros to make it easier for me to add some local changes. Here's the result if you'd like to incorporate it into the distribution. #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create: # less.1 # This archive created: Mon Aug 25 15:21:28 1986 export PATH; PATH=/bin:/usr/bin:$PATH if test -f 'less.1' then echo shar: "will not over-write existing file 'less.1'" else cat << \SHAR_EOF > 'less.1' .TH LESS 1 .SH NAME less \- opposite of more .SH SYNOPSIS .B less [ .B \-cdepstwmMqQuU ] [ .BI \-h n ] [ .BI \-b[fp] n ] [ .BI \-x n ] [ .BI \-[z] n ] [+\fIcmd\fP ] [ .I name ] ... .SH DESCRIPTION .I Less is a program similar to .IR more (1), but which allows backwards movement in the file as well as forward movement. Also, .I less does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like .IR vi (1). .I Less uses termcap, so it can run on a variety of terminals. There is even limited support for hardcopy terminals. (On a hardcopy terminal, lines which should be printed at the top of the screen are prefixed with an up-arrow.) .PP Commands are based on both .I more and .IR vi . Commands may be preceeded by a decimal number, called .I N in the descriptions below. The number is used by some commands, as indicated. .SH COMMANDS .TP 7 7 .B h Help: display a summary of these commands. If all the other commands are forgotten, remember this one. .TP 7 7 .B SPACE Scroll forward .I N lines, default one window (see option .B \-z below). If .I N is more than the screen size, only one screenful is displayed. .TP 7 7 .B f Same as .BR SPACE . .TP 7 7 .B b Scroll backward .I N lines, default one window (see option .B \-z below). If .I N is more than the screen size, only one screenful is displayed. .TP 7 7 .B RETURN Scroll forward .I N lines, default 1. If .I N is more than the screen size, the entire .I N lines are displayed. .TP 7 7 .B e Same as .BR RETURN . .TP 7 7 .B j Also the same as .BR RETURN . .TP 7 7 .B y Scroll backward .I N lines, default 1. If .I N is more than the screen size, the entire .I N lines are displayed. .TP 7 7 .B k Same as .BR y . .PP .TP 7 7 .B d Scroll forward .I N lines, default 10. If .I N is specified, it becomes the new default for all .B d and .B u commands. .PP .TP 7 7 .B u Scroll backward .I N lines, default 10. If .I N is specified, it becomes the new default for all .B d and .B u commands. .TP 7 7 .B r Repaint the screen. .TP 7 7 .B R Repaint the screen, discarding any buffered input. Useful if the file is changing while it is being viewed. .TP 7 7 .B g Go to line .I N in the file, default 1 (beginning of file). (Warning: this may be slow if .I N is large.) .TP 7 7 .B G Go to line .I N in the file, default the end of the file. (Warning: this may be slow if standard input, rather than a file, is being read.) .TP 7 7 .B p Go to a position .I N percent into the file. .I N should be between 0 and 100. (This is possible if standard input is being read, but only if .I less has already read to the end of the file. It is always fast, but not always useful.) .TP 7 7 .B % Same as .BR p . .TP 7 7 .BI m l Followed by any lowercase letter, .IR l , marks the current position with that letter. .TP 7 7 .BI ' l Followed by any lowercase letter, .IR l , returns to the position which was previously marked with that letter. All marks are lost when a new file is examined. .TP 7 7 .BI / pattern Search forward in the file for the .IR N -th occurence of the .IR pattern . .I N defaults to 1. The .I pattern is a regular expression, as recognized by .IR ed (1). The search starts at the second line displayed (but see the .B \-t option, which changes this). .TP 7 7 .BI ? pattern Search backward in the file for the .IR N -th occurence of the .IR pattern . The search starts at the line immediately before the top line displayed. .TP 7 7 .B n Repeat previous search, for .IR N -th occurence of the last .IR pattern . .TP 7 7 .BI E\ [filename] Examine a new file. If the .I filename is missing, the "current" file (see the .B N and .B P commands below) from the list of files in the command line is re-examined. .TP 7 7 .B N Examine the next file (from the list of files given in the command line). If a number .I N is specified (not to be confused with the command .BR N ), the .IR N -th next file is examined. .TP 7 7 .B P Examine the previous file. If a number .I N is specified, the .IR N -th previous file is examined. .TP 7 7 .B = Prints the name of the file being viewed and the byte offset of the bottom line being displayed. If possible, it also prints the length of the file and the percent of the file above the last displayed line. .TP 7 7 .B \- Followed by one of the command line option letters (see below), this will toggle the setting of that option and print a message describing the new setting. .TP 7 7 .B V Prints the version number of .I less being run. .TP 7 7 .B q Exits .IR less . .PP The following two commands may or may not be valid, depending on your particular installation. .TP 7 7 .B v Invokes an editor to edit the current file being viewed. The editor is taken from the environment variable .BR EDITOR , or defaults to .IR vi . .TP 7 7 .BI ! shell-command Invokes a shell to run the .I shell-command given. .SH OPTIONS Command line options are described below. Options are also taken from the environment variable .BR LESS . (The environment variable is parsed before the command line, so command line options override the .B LESS environment variable. Options may be changed while .I less is running via the .B \- command.) For example, if more-style prompting is desired, to avoid typing .B "less \-m" each time .I less is invoked, .I csh can be told: .PP .B "setenv LESS m" .PP or if .I sh is used: .PP .B "LESS=m; export LESS" .PP .TP 7 7 .B \-s Consecutive blank lines are squeezed into a single blank line. This is useful when viewing .I nroff output. .TP 7 7 .B \-t Normally, forward searches start just after the top displayed line (that is, at the second displayed line). Thus forward searches include the currently displayed screen. The .B \-t option causes forward searches to start just after the bottom line displayed, thus skipping the currently displayed screen. .TP 7 7 .B \-m Use .IR more (1) style prompting (file name and percent into the file) instead of a ':'. .TP 7 7 .B \-M Even more verbose prompting. .TP 7 7 .B \-q Normally, if an attempt is made to scroll past the end of the file or before the beginning of the file, the terminal bell is rung to indicate this fact. .B \-q quiets the bell. If the terminal has a "visual bell", it is used instead. .TP 7 7 .B \-Q Even if .B \-q is given, .I less will ring the bell on certain other errors, such as typing an invalid character. The .B \-Q option causes .I less to be quiet all the time; that is, never ring the terminal bell. If the terminal has a "visual bell", it is used instead. .TP 7 7 .B \-e Normally the only way to exit .I less is via the .B q command. The .B \-e option causes .I less to automatically exit the second time it reaches end-of-file. .TP 7 7 .B \-u Treat backspaces as printable characters; that is, they are sent to the terminal when they appear in the input. .TP 7 7 .B \-U Print backspaces as the two character sequence "^H". If neither .B \-u nor .B \-U is given, backspaces which appear adjacent to an underscore character or sequences of a character interleaved with backspaces are treated specially: the underlined or boldfaced text is displayed using the terminal's hardware capability. Note that the .B \-v option below superceeds both .B \-u and .BR \-U . .TP 7 7 .B \-w Use blank lines instead of tilde characters to represent lines past end of file. .TP 7 7 .B \-d Normally, .I less complains if the terminal is dumb; that is, lacks some important capability, such as the ability to clear the screen or scroll backwards. The .B \-d flag suppresses this complaint (but does not otherwise change the behavior of the program on a dumb terminal). .TP 7 7 .B \-p Normally when .I less needs to change the entire display, it will repaint the screen by scrolling from the bottom of the screen. If .B \-p is given, it will clear the screen and paint from the top line down. .TP 7 7 .BI \-h n Normally, .I less will scroll backwards when backwards movement is necessary. The .B \-h option specifies a maximum number of lines to scroll backwards. If it is necessary to move backwards more than this many lines, the screen is repainted in a forward direction. (If the terminal does not have the ability to scroll backwards, .BI \-h 0 is implied.) .TP 7 7 .BI \-[z] n When given a backwards or forwards window command, .I less will by default scroll backwards or forwards one screenful of lines. The .B \-z option changes the default scrolling window size to .I n lines. If .I n is greater than the screen size, the scrolling window size will be set to one screenful. Note that the .B z is optional for compatibility with .IR more . .TP 7 7 .BI \-x n Set tab stops every .I n positions. The default for .I n is 8. .TP 7 7 .BI \-b[fp] n The .B \-b option causes .I less to use a non-standard buffer size. There are two standard (default) buffer sizes, one is used when a file is being read and the other when a pipe (standard input) is being read. The current defaults are 5 buffers for files and 12 for pipes. (Buffers are 1024 bytes.) The number .I n specifies the number of buffers to use. The .B \-b may be followed by .BR f , in which case only the file default is changed, or by .B p in which case only the pipe default is changed. Otherwise, both are changed. .TP 7 7 .B \-c Normally, when data is read by .IR less , it is scanned to ensure that bit 7 (the high order bit) is turned off in each byte read, and to ensure that there are no null (zero) bytes in the data (null bytes are turned into "@" characters). If the data is known to be "clean", the .B \-c option will tell .I less to skip this checking, causing an imperceptible speed improvement. (However, if the data is not "clean", unpredicatable results may occur.) .TP 7 7 .B \-v Print non-printing characters in a visible way ala .IR cat (1). Control characters are printed as ^X (the delete character (octal 0177) is printed as ^?). Characters with the 0200 bit set are printed as M- followed by the character represented by the low order seven bits. .TP 7 7 .BI + command If a command line option begins with .BR + , the remainder of that option is taken to be an initial command to .IR less . For example, .BI + G tells .I less to start at the end of the file rather than the beginning, and .BI + /xyz tells it to start at the first occurence of .I xyz in the file. As a special case, .BI + acts like .BI + g; that is, it starts the display at the specified line number (however, see the caveat under the .B g command above). If the option starts with .BR ++ , the initial command applies to every file being viewed, not just the first one. .SH BUGS When used on standard input (rather than a file), backwards motion is limited to that portion of the file which is still buffered. SHAR_EOF fi exit 0 # End of shell archive Paul Pomes UUCP: {ihnp4,pur-ee,convex}!uiucdcs!uiucuxc!paul ARPANET: paul%uxc@a.cs.uiuc.edu CSNET: paul%uxc@uiuc.csnet ICBM: 40 07 N / 88 13 W BITNET: paul@uiucuxc US Mail: Univ of Illinois, CSO, 1304 W Springfield Ave, Urbana, IL 61801