首页 > 编程知识 正文

less乱码 more不乱码,linux less中文乱码

时间:2023-05-06 16:00:03 阅读:273603 作者:109

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.

您可以使用up和down键,或使用space bar和b来逐页浏览文件内容。 您也可以按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五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。