Add a break(a red line) after every bash output¶
When using bash, I want to append a break or something else like a red line to the command output, so that I can clearly distinguish multiple command results.
Preview the effect¶
By default, every bash output has no gap between each other:
After configuration, every bash output has a red line between each other:
The latter is much more clear than the former.
How to make it happen¶
To add a red line between outputs, edit ~/.bashrc
and add the following line:
PROMPT_COMMAND='echo "$(tput setaf 1)--------------------$(tput sgr0)"'
I just want a simple break¶
If a simple break is enough for you, it's easier. Edit ~/.bashrc
and add the following line:
PROMPT_COMMAND='echo'
This article is originally created by tooli.top. Please indicate the source when reprinting : https://www.tooli.top/posts/bash_newline
Posted on 2022-04-11
Mail to author