Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I remove the PWD from the terminal? I'm not referring to the command but the automatic display next to my username@hostname. I would like it to work more like it does on other distros.

Thank you.

share|improve this question
up vote 5 down vote accepted

Go to your home directory and edit .bashrc file. There you can find lines that look similar to this one:

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

Delete \w and current working directory will dissappear.

share|improve this answer
Thank you. The PS1 was a great keyword. It let me find this… – DonCoryon Nov 21 '12 at 18:25

The appearance of the prompt is based upon the value of the environment variable $PS1. To see it use:

    echo $PS1

You'll see something like this:

    \[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$

To remove your current working directory from your prompt, just remove the '\w' from the variable.

    export PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\$'

You'll get the prompt without the present working directory now. To make the effect permanent, add that line to .bashrc file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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