你怎么能在你的LESS环境variables中设置-R?

问题是基于这个答案 。

你怎么能在你的LESS环境variables中设置-R?

从手册中看到:

Options are also taken from the environment variable "LESS". For example, to avoid typing "less -options ..." each time less is invoked, you might tell csh: setenv LESS "-options" or if you use sh: LESS="-options"; export LESS 

如果你使用的Bash是各种发行版的默认版本,我们可以这样做:

 export LESS="-R" 

如果你想在shell / login会话中永久保存,那么你需要将上面的命令添加到相应的文件中,以Bash为例,再次使用文本编辑器打开$ HOME / .bashrc并放下在导出命令中。 这意味着每次Bash调用它都会运行export命令,设置你的Less偏好设置。

希望有帮助:-)