most 命令详解

| 选择喜欢的代码风格  

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

most 命令安装:


-bash/zsh: most: command not found

# Windows (WSL2)
sudo apt-get update sudo apt-get install most

# Debian
apt-get install most

# Ubuntu
apt-get install most

# Arch Linux
pacman -S most

# Kali Linux
apt-get install most

# Fedora
dnf install most

# OS X
brew install most

# Raspbian
apt-get install most

# Dockerfile
dockerfile.run/most

most 命令补充说明:


most 是一个分页程序,一次显示一个窗口,在终端上显示文件的内容。

most 在每个窗口之后暂停并在屏幕上的窗口状态行上打印文件名称、当前行号以及迄今为止显示的文件百分比。与其他分页程序不同,大多数分页程序都能够显示任意数量的窗口,只要每个窗口至少占据两个屏幕行。 每个窗口可能包含相同的文件或一个不同的文件。 此外,每个窗口都有自己的模式。

most 命令语法:


most [-1Cbcdkstvw] [+/string] [+line number] [+s] [+d] file...

most 命令选项:


-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 containing 8 bit characters. most will display the file 16 bytes per line in hexidecimal 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.#. @...
-k
'Kanji' option. Ordinarily, most will go into binary mode if the file consists of non-ascii characters. Sometimes this feature is not desirable since some terminals have a special interpretation for eight bit characters. The -k option turns off the automatic sensing.

-C

Disable color support.

-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 search case sensitive. By default, they are not.

+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 interactive 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 carriage 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 meaningful.
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 ignoring all lines indented beyond the first column. So for the example above, most would display:
int main(int argc, char **argv)...
}
where the '...' indicates lines follow are not displayed.

most 命令实例:


most 打开一个文件:

most path/to/file

most 打开多个文件:

most path/to/file1 path/to/file2

most 打开文件,并在第一次出现 string 的位置:

most path/to/file +/string

most 浏览打开的文件:

:O n

most 跳转到第 100 行:

100j

most 编辑当前文件:

e

most 将当前窗口分成两半:

<CTRL-x> o

退出 most:

Q

most 命令扩展阅读:




most 命令评论