1

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.

6

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.

| improve this answer | |
1

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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