Show full hostname in bash?

Any way to show full hostname in bash instead of partial?

Now for domain.com it's:

user@domain:~$

Would like it to be:

[email protected]:~$

Debian 8.5


Solution 1:

The bash prompt is configured by the PS1 variable. You can configure it simply by setting the variable for example like this:

export PS1="$(hostname -f):~$ "

If you want to make the configuration permanent you can put the export command in your ~/.bashrc file.

I recommend reading the ArchWiki Page for more information.