1

When working on the terminal like:

algorithms@assistant:~$ ls
Desktop    Downloads  Music     Public  Templates         Videos
Documents  gtd.org    Pictures  snap    version-check.sh

the command ls is constantly aligned with username@hostname.

How could I separate them into independent lines? Example:

algorithms@assistant:
~$ ls
1
  • 2
    Add a "\n" (newline) at the relevant place in the PS1 variable?
    – Soren A
    Jan 9, 2019 at 9:35

1 Answer 1

3

A bit more detail of Soren A comment. Edit the file .bashrc with editor.

editor ~/.bashrc

Then lockup for the following line

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

Add the \n (new line) special character just before the \$ at the end of the line. You should have a line looks like :

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\n\$ '

You must log in to answer this question.

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