0

I've done some googling, and looking around this stack overflow, but this one seems to elude me.

How might I reduce/edit the displayed bash name on the terminal prompt? I.E.

This:

fresearch@fresearch-MM061:~/Desktop/blog$

To:

|>$

I (sort of) know who I am, and (sometimes) know where I am. I have a small laptop screen, and would rather have the screen space. I have read through some of the bash man pages, but I decided not to start mucking about with vital settings files, and no idea what I was doing.

Thoughts?

Thanks!

  • 2
    Oh look, the exact thing I was looking for!

    http://askubuntu.com/a/145626/265730

    Man, I spent like 20 minutes looking for this before hand. #programmerproblems

    – user18920 Apr 05 '14 at 21:52
  • You can lengthen it but have a [return] at the end. See http://unix.stackexchange.com/q/88780/10043 – Michael Durrant May 23 '14 at 22:18

1 Answers1

1

What you want is called bash prompt

To get |>$ simply run PS1="|>$" in your terminal, if this is what you want then you should edit your .bashrc to make it permanent.

Find section looked like this:

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi

And if you are not using colored prompt, then correct line after word else before fi:

PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

to this line

PS1='${debian_chroot:+($debian_chroot)}|>$'
c0rp
  • 9,820
  • 3
  • 38
  • 60