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:
1 |
|
(2) Use tput
1 2 |
|
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!