What are the methods to prevent the output of linux grep from breaking new lines?

王林
Release: 2019-11-14 09:44:58
Original
5821 people have browsed it

What are the methods to prevent the output of linux grep from breaking new lines?

Environment:

RedHat

Originally, the output of ps -ef will not wrap lines, but ps -ef | grep java will change the line.

If you want the grep results to not have new lines, there are two methods.

Solution:

(1) Splice less -S:

ps -ef | grep java | less -S
Copy after login

(2) Use tput

tput rmam  # 关闭换行
tput smam  # 打开换行
Copy after login

Recommended tutorial: Linux tutorial

The above is the detailed content of What are the methods to prevent the output of linux grep from breaking new lines?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template