Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我使用的系统中,默认情况下禁用“less”查看器的自动换行模式。根据“less”查看器帮助,使用 -S 或 --chop-long-lines 标志禁用它。我没有找到如何在我的系统上强制自动换行。是否有任何已知的标志或任何其他方式来启用该模式?
使用 禁用自动换行-S。在手册页之后,您可以通过传递-+S到命令行来重置该选项。
-S
-+S
假设您已$LESS设置为-S,您可以在命令行上重新启用它
$LESS
less -+S file
您可以尝试使用LESS环境变量。例如,您可以将以下内容放入系统范围的 shell 初始化脚本(/etc/profile对于 bash/ksh):
LESS
/etc/profile
export LESS="-S "