Home
Sign Up
Sign In
Distributions
›
Ubuntu
›
Fedora
›
CentOS
中文资源站
›
网易开源镜像站
V2EX
›
Linux
less 命令在与管道工作时,为什么会自动退出交互模式?
James369
·
Dec 18, 2020
· 1847 views
This topic created in 1983 days ago, the information mentioned may be changed or developed.
当直接 less xxx 文件时,是处于一种交互模式,即可以进行上下翻页操作。
但是在 less xxx | grep yyy 时,它就会自动退出交互模式,而直接将文件全部内容输出到 grep 命令。
less 命令是如何识别到当前所处的执行环境的?
Less
grep
命令
交互
3 replies
•
2020-12-18 10:56:44 +08:00
1
lululau
Dec 18, 2020
1
man 3 isatty
2
codehz
Dec 18, 2020 via Android
1
https://man7.org/linux/man-pages/man3/isatty.3.html
3
James369
OP
Dec 18, 2020
明白了,漂亮。。。
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Solana
·
2882 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 466ea39e · 43ms ·
UTC 06:47
·
PVG 14:47
·
LAX 23:47
·
JFK 02:47
♥ Do have faith in what you're doing.
❯