Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

2 Answers 2

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 cyberciti.biz/tips/… –  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

 
discard

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.