less命令乱码_less命令

less命令乱码

The less command is one I use a lot. It shows you the content stored inside a file, in a nice and interactive UI.

less命令是我经常使用的命令。 它以精美的交互式UI向您显示文件中存储的内容。

Usage: less <filename>.

用法: less <filename>

Once you are inside a less session, you can quit by pressing q.

进入less会话后,可以按q退出。

You can navigate the file contents using the up and down keys, or using the space bar and b to navigate page by page. You can also jump to the end of the file pressing G and jump back to the start pressing g.

您可以使用updown键,或使用space barb来逐页浏览文件内容。 您也可以按G跳到文件末尾,然后按g跳回到文件头。

You can search contents inside the file by pressing / and typing a word to search. This searches forward. You can search backwards using the ? symbol and typing a word.

您可以通过按/并输入一个单词来搜索文件内的内容。 这向前搜索。 您可以使用?向后搜索? 符号并输入一个单词。

This command just visualises the file’s content. You can directly open an editor by pressing v. It will use the system editor, which in most cases is vim.

该命令仅可视化文件的内容。 您可以通过按v直接打开编辑器。 它将使用系统编辑器,在大多数情况下为vim

Pressing the F key enters follow mode, or watch mode. When the file is changed by someone else, like from another program, you get to see the changes live. By default this is not happening, and you only see the file version at the time you opened it. You need to press ctrl-C to quit this mode. In this case the behaviour is similar to running the tail -f <filename> command.

F键进入跟随模式观看模式 。 当其他人(例如从另一个程序)更改文件时,您可以实时看到更改。 默认情况下,这不会发生,并且您仅在打开文件时看到文件版本。 您需要按ctrl-C退出此模式。 在这种情况下,其行为类似于运行tail -f <filename>命令。

You can open multiple files, and navigate through them using :n (to go to the next file) and :p (to go to the previous).

您可以打开多个文件,并使用:n (转到下一个文件)和:p (转到上一个)浏览它们。

This command works on Linux, macOS, WSL, and anywhere you have a UNIX environment

此命令可在Linux,macOS,WSL以及您拥有UNIX环境的任何地方使用

翻译自: https://flaviocopes.com/unix-command-less/

less命令乱码

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值