5

I want to modify my output in bash for better view of output. Simply put \n before this. How can I change it in .bashrc? For example:

It's default:

root@comp:$ abc
bash: abc: command not found

I want this:

root@comp:$ abc

bash: abc: command not found

1 Answer 1

11

You can trap the DEBUG signal:

trap 'printf "\n"' DEBUG

DEBUG trapped command printf "\n" will be run before the command is executed unlike PROMPT_COMMAND which will be run after the command is executed.

You can add this to your ~/.bashrc to make it permanent.

Example:

$ abc
No command 'abc' found, did you mean:
....
$ trap 'printf "\n"' DEBUG
$ abc

No command 'abc' found, did you mean:
....
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .