I use powerline-shell and my prompt looks like:

enter image description here.

How can I get rid of my name and hostname in the prompt?

I tried to search in .bashrc file for PS1 variables:

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

Which I have to edit to the goal?

  • 3
    Since you are using powerline-shell, which claims to provide "A beautiful and useful prompt for your shell [that is] easy to customize and extend", then I would venture that the answer to your question is in the powerline-shell documentation. It almost certainly won't help to change your bash prompt, as the whole point of prompt beautifiers is that they replace the bash prompt. – zwets Aug 7 '18 at 22:13
  • 1
    Well the sequence for hostname would be \h - so for example the default Ubuntu ~/.bashrc (copied from /etc/skel/.bashrc) includes \u@\h in its PS1 string - yours does not appear to do the same – steeldriver Aug 7 '18 at 22:49

You need to change this in your powerline config file which is normally located under ~/.config/powerline-shell/config.json.

If you haven't one yet you can create one using the following commands:

mkdir -p ~/.config/powerline-shell
powerline-shell --generate-config > ~/.config/powerline-shell/config.json

Then simply remove the segments you dont want like username or hostname. For more information see the docs

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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