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.
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.
\w
from all the lines that match the PS1
search within the .bashrc
file
Aug 23, 2022 at 14:40
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.