カラー表示できるPagerのmostをインストールしてみました。
John E. Davis Software
https://www.jedsoft.org/
- インストール
mostはepel repoにあります。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# yum info most Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.iij.ad.jp * epel: mirrors.tongji.edu.cn * extras: ftp.iij.ad.jp * updates: ftp.iij.ad.jp Available Packages Name : most Arch : x86_64 Version : 5.0.0 Release : 14.a.1.el7 Size : 57 k Repo : epel/x86_64 Summary : more, less, most URL : ftp://space.mit.edu/pub/davis/most/ License : GPLv2+ Description : most is a paging program that displays, one window-full at a time, : the contents of a file on a terminal. It pauses after each : window-full and prints on the window status line the screen the file : name, current line number, and the percentage of the file so far : displayed. # yum install most Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.iij.ad.jp * epel: mirrors.tongji.edu.cn * extras: ftp.iij.ad.jp * updates: ftp.iij.ad.jp Resolving Dependencies --> Running transaction check ---> Package most.x86_64 0:5.0.0-14.a.1.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved =================================================================================== Package Arch Version Repository Size =================================================================================== Installing: most x86_64 5.0.0-14.a.1.el7 epel 57 k Transaction Summary =================================================================================== Install 1 Package Total download size: 57 k Installed size: 109 k Is this ok [y/d/N]: y Downloading packages: most-5.0.0-14.a.1.el7.x86_64.rpm | 57 kB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : most-5.0.0-14.a.1.el7.x86_64 1/1 Verifying : most-5.0.0-14.a.1.el7.x86_64 1/1 Installed: most.x86_64 0:5.0.0-14.a.1.el7 Complete! |
.bashrcなどでexport PAGER="most"
を設定しておけばmanコマンドなどをカラー表示できます。
Help
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# most --help MOST version 5.0.0 (S-Lang version 2.2.4) Usage: most [-1Cbcdkstvw] [+/string] [+line number] [+s] [+d] file... where: -1: assume VT100 terminal. (VMS only) -b: Startup in binary mode. -C: disable color support -c: Make searches case sensitive. -d: Do not display the \ wrap marker when wrapping lines. -M: Do not attempt to mmap files. -s: Squeeze out excess blank lines. -t: Display tabs as ^I. If this option is immediately followed by an integer, the integer sets the tab width. -u: Disable UTF-8 mode -v: Do not interpret backspace formatting characters. -w: Wrap lines. -z: No gunzip-on-the-fly. +/string: Search for string +line number Start up at specified line number. +d: Allow file deletion. +s: Secure Mode-- no edit, cd, shell, and reading files not already listed on the command line. +u: Enable UTF-8 mode. Example: most -ct4 +82 keymap.c makes searches case sensitive, sets tabwidth to 4, and displays the file keymap.c starting at line 82. |
man
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
MOST(1) General Commands Manual MOST(1) NAME most - browse or page through a text file SYNOPSIS most [-1bCcdMstuvwz] [+lineno] [+c] [+d] [+s] [+u] [+/string] [file- name...] DESCRIPTION most is a paging program that displays, one windowful at a time, the con- tents of a file on a terminal. It pauses after each windowful and prints on the window status line the screen the file name, current line number, and the percentage of the file so far displayed. Unlike other paging programs, most is capable of displaying an arbitrary number of windows as long as each window occupies at least two screen lines. Each window may contain the same file or a different file. In addition, each window has its own mode. For example, one window may dis- play a file with its lines wrapped while another may be truncating the lines. Windows may be `locked' together in the sense that if one of the locked windows scrolls, all locked windows will scroll. most is also capable of ignoring lines that are indented beyond a user specified value. This is useful when viewing computer programs to pick out gross features of the code. See the `:o' command for a description of this feature. In addition to displaying ordinary text files, most can also display binary files as well as files with arbitrary ascii characters. When a file is read into a buffer, most examines the first 32 bytes of the file to determine if the file is a binary file and then switches to the appro- priate mode. However, this feature may be disabled with the -k option. See the description of the -b, -k, -v, and -t options for further details. Text files may contain combinations of underscore and backspace charac- ters causing a printer to underline or overstrike. When most recognizes this, it inserts the appropriate escape sequences to achieve the desired effect. In addition, some files cause the printer to overstrike some characters by embedding carriage return characters in the middle of a line. When this occurs, most displays the overstruck character with a bold attribute. This feature facilitates the reading of UNIX man pages or a document produced by runoff. In particular, viewing this document with most should illustrate this behavior provided that the underline characters have not been stripped. This may be turned off with the -v option. By default, lines with more characters than the terminal width are not wrapped but are instead truncated. When truncation occurs, this is indi- cated by a `$' in the far right column of the terminal screen. The RIGHT and LEFT arrow keys may be used to view lines which extend past the mar- gins of the screen. The -w option may be used to override this feature. When a window is wrapped, the character `\' will appear at the right edge of the window. Commands are listed below. OPTIONS -1 VT100 mode. This is meaningful only on VMS systems. This option should be used if the terminal is strictly a VT100. This implies that the terminal does not have the ability to delete and insert multiple lines. VT102s and above have this ability. -b Binary mode. Use this switch when you want to view files contain- ing 8 bit characters. most will display the file 16 bytes per line in hexadecimal notation. A typical line looks like: 01000000 40001575 9C23A020 4000168D ....@..u.#. @... When used with the -v option, the same line looks like: ^A^@^@^@ @^@^U u 9C #A0 @^@^V8D ....@..u.#. @... -C Disable color support. -d Omit the backslash mark used to denote a wrapped line. -M Disable the use of mmap. -s Squeeze. Replace multiple blank lines with a single blank line. -z option turns off gunzip-on-the-fly. -v Display control characters as in `^A' for control A. Normally most does not interpret control characters. -t Display tabs as `^I'. This option is meaningful only when used with the -v option. +lineno Start up at lineno. -c Make searches case sensitive. By default, they are not. -u Disable UTF-8 mode even if the locale dictates it. +u Force UTF-8 mode. By default most will use the current locale to determine if UTF-8 mode shoul be used. The +u and -u switches allow the behavior to be overridden. +d This switch should only be used if you want the option to delete a file while viewing it. This makes it easier to clean unwanted files out of a directory. The file is deleted with the interac- tive key sequence `:D' and then confirming with `y'. +/string Start up at the line containing the first occurrence of string. COMMAND USAGE The commands take effect immediately; it is not necessary to type a car- riage return. In the following commands, i is a numerical argument (1 by default). SPACE, CTRL-D, NEXT_SCREEN Display another windowful, or jump i windowfuls if i is specified. RETURN, DOWN_ARROW, V, CTRL-N Display another line, or i more lines, if specified. UP_ARROW, ^, CTRL-P Display previous line, or i previous lines, if specified. T, ESCAPE< Move to top of buffer. B, ESCAPE> Move to bottom of buffer. RIGHT_ARROW, TAB, > Scroll window left 60i columns to view lines that are beyond the right margin of the window. LEFT_ARROW, CTRL-B, < Scroll window right 60i columns to view lines that are beyond the left margin of the window. U, CTRL-U, DELETE, PREV_SCREEN Skip back i windowfuls and then print a windowful. R, CTRL-R Redraw the window. J, G If i is not specified, then prompt for a line number then jump to that line otherwise just jump to line i. % If i is not specified, then prompt for a percent number then jump to that percent of the file otherwise just jump to i percent of the file. W, w If the current screen width is 80, make it 132 and vice-versa. For other values, this command is ignored. Q, CTRL-X CTRL-C, CTRL-K E Exit from most. On VMS, ^Z also exits. h, CTRL-H, HELP, PF2 Help. Give a description of all the most commands. The most environment variable MOST_HELP must be set for this to be meaning- ful. f, /, CTRL-F, FIND, GOLD PF3 Prompt for a string and search forward from the current line for ith distinct line containing the string. CTRL-G aborts. ? Prompt for a string and search backward for the ith distinct line containing the string. CTRL-G aborts. n Search for the next i lines containing an occurrence of the last search string in the direction of the previous search. m, SELECT, CTRL-@, CTRL-K M, PERIOD Set a mark on the current line for later reference. INSERT_HERE, CTRL-X CTRL-X, COMMA, CTRL-K RETURN, GOLD PERIOD Set a mark on the current line but return to previous mark. This allows the user to toggle back and forth between two positions in the file. l, L Toggle locking for this window. The window is locked if there is a `*' at the left edge of the status line. Windows locked together, scroll together. CTRL-X 2, CTRL-W 2, GOLD X Split this window in half. CTRL-X o, CTRL-W o, o, GOLDUP, GOLDDOWN Move to other window. CTRL-X 0, CTRL-W 0, GOLD V Delete this window. CTRL-X 1, CTRL-W 1, GOLD O Delete all other windows, leaving only one window. E, e Edit this file. $, ESC $ This is system dependent. On VMS, this causes most to spawn a subprocess. When the user exits the process, most is resumed. On UNIX systems, most simply suspends itself. :n Skip to the next filename given in the command line. Use the arrow keys to scroll forward or backward through the file list. `Q' quits most and any other key selects the given file. :c Toggle case sensitive search. :D Delete current file. This command is only meaningful with the +d switch. :o, :O Toggle various options. With this key sequence, most displays a prompt asking the user to hit one of: bdtvw. The `b', `t', `v', and `w' options have the same meaning as the command line switches. For example, the `w' option will toggle wrapping on and off for the current window. The `d' option must be used with a prefix integer i. All lines indented beyond i columns will not be displayed. For example, consider the fragment: int main(int argc, char **argv) { int i; for (i = 0; i < argc, i++) { fprintf(stdout,"%i: %s\n",i,argv[i]); } return 0; } The key sequence `1:od' will cause most to display the file ignor- ing all lines indented beyond the first column. So for the exam- ple above, most would display: int main(int argc, char **argv)... } where the `...' indicates lines follow are not displayed. HINTS CTRL-G aborts the commands requiring the user to type something in at a prompt. The backquote key has a special meaning here. It is used to quote certain characters. This is useful when search for the occurrence of a string with a control character or a string at the beginning of a line. In the latter case, to find the occurrence of `The' at the begin- ning of a line, enter `^JThe where ` quotes the CTRL-J. ENVIRONMENT most uses the following environment variables: MOST_SWITCHES This variable sets commonly used switches. For example, some peo- ple prefer to use most with the -s option so that excess blank lines are not displayed. On VMS this is normally done done in the login.com through the line: $ define MOST_SWITCHES "-s" MOST_EDITOR, SLANG_EDITOR Either of these environment variables specify an editor for most to invoke to edit a file. The value can contain %s and %d format- ting descriptors that represent the file name and line number, respectively. For example, if JED is your editor, then set MOST_EDITOR to 'jed %s -g %d'. MOST_HELP This variable may be used to specify an alternate help file. MOST_INITFILE Set this variable to specify the initialization file to load dur- ing startup. The default action is to load the system configura- tion file and then a personal configuration file called .mostrc on Unix, and most.rc on other systems. CONFIGURATION FILE SYNTAX When most starts up, it tries to read a system configuration file and then a personal configuration file. These files may be used to specify keybindings and colors. To bind a key to a particular function use the syntax: setkey function-name key-sequence The setkey command requires two arguments. The function-name argument specifies the function that is to be executed as a response to the keys specified by the key-sequence argument are pressed. For example, setkey "up" "^P" indicates that when Ctrl-P is pressed then the function up is to be exe- cuted. Sometimes, it is necessary to first unbind a key-sequence before rebind- ing it in order via the unsetkey function: unsetkey "^F" Colors may be defined through the use of the color keyword in the the configuration file using the syntax: color OBJECT-NAME FOREGROUND-COLOR BACKGROUND-COLOR Here, OBJECT-NAME can be any one of the following items: status -- the status line underline -- underlined text overstrike -- overstriked text normal -- anything else See the sample configuration files for more information. BUGS Almost all of the known bugs or limitations of most are due to a desire to read and interpret control characters in files. One problem concerns the use of backspace characters to underscore or overstrike other charac- ters. most makes an attempt to use terminal escape sequences to simulate this behavior. One side effect is the one does not always get what one expects when scrolling right and left through a file. When in doubt, use the -v and -b options of most. AUTHOR John E. Davis davis@space.mit.edu ACKNOWLEDGEMENTS I would like to thank the users of most for valuable comments and criti- cisms. I would especially like to thank those individuals who have con- tributed code to most. Mats Akerberg, Henk D. Davids, Rex O. Livingston, and Mark Pizzolato con- tributed to the early VMS versions of most. In particular, Mark worked on it to get it ready for DECUS. Foteos Macrides <MACRIDES@SCI.WFEB.EDU> adapted most for use in cswing and gopher. A few features of the present version of most was inspired from his work. I am grateful to Robert Mills <robert@jna.com.au> for re-writing the search routines to use regular expressions. Sven Oliver Moll <smol0075@rz.uni-hildesheim.de> came up with the idea of automatic detection of zipped files. I would also like to thank Shinichi Hama for his valuable criticisms of most. Javier Kohen was instrumental in the support for UTF-8. Thanks to David W. Sanderson (dws@cs.wisc.edu) for adapting the documen- tation to nroff man page source format. May 1999 MOST(1) |