Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

day 11 - linux 命令 : more #80

Open
hoperyy opened this issue Oct 12, 2017 · 0 comments
Open

day 11 - linux 命令 : more #80

hoperyy opened this issue Oct 12, 2017 · 0 comments

Comments

@hoperyy
Copy link
Owner

hoperyy commented Oct 12, 2017

day 11 - linux 命令 : more

more 类似 cat

cat 是将整个文件的内容从上到下显示在屏幕上。

more 是一页一页地显示,方便使用者阅读,指令就是 空格(space) 和 b(back)键;同时还有搜寻字符串的功能。

more 命令从前向后读取文件,因此在启动时就加载整个文件。

语法

more [选项] 文件……

选项

  • +n:从第 n 行开始显示
  • -n:定义屏幕大小为 n 行
  • +/pattern:搜寻字符串,并从该字符串前两行之后开始显示
  • -c:从顶部清屏后显示
  • -u:禁止下划线
  • -s:将多个空行压缩成一行显示

实例

  • 显示文件中从第 3 行起的内容

    more +3 a.log

  • 从文件中查找第一个出现 day 字符串的行,并从该处前两行开始显示输出

    more +/day a.log

  • 设定每屏显示的行数

    more -5 a.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant