I would like to configure the terminal so that it would leave a line after running a command. Just to make stuff cleaner. There is no such setting in "profile preferences".

I'm running 12.10.


To alter how bash works you need to edit the hidden file ~/.bashrc

gedit ~/.bashrc

First find the section that look like this:

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

and change it slightly to look like this (or cut and paste this in replacing the existing section).

###Changed prompt to print a \n 'new line' before user@machine###
if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\n\u@\h:\w\$ '

The difference is subtle - just added an escaped newline '\n' before the user@machine prompt. Save the file and exit the terminal window. Changes will take effect next time you open a terminal window or log in to a console.

The reason you have to change both of the lines is that the first one is for the colour prompt, while the second one is for the default monochrome prompt. Actually, before you add in the new line, try the colour prompt first. It does help to delineate the prompt/command/result each time. You might like it. All you have to do is find the slightly earlier line that looks like


and uncomment it by removing the hash:

  • The "force_color_prompt" is brilliant, exactly what I needed! Nov 25 '12 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.