只需一步,快速开始
使linux grep的输出不换行的方法有:1、在后面拼接less -S,使用命令ps -ef | grep java | less -S;2、使用tput,命令为tput rmam。
环境:
RedHat
本来ps -ef的输出是不会换行的,但是 ps -ef | grep java 就换行了。
如果想让grep完的结果不要换行,有两种方法。
解决方法:
(一)在后面拼接 less -S:
ps -ef | grep java | less -S
(二)使用 tput
tput rmam # 关闭换行 tput smam # 打开换行
首页
分类
索引
我的