Ubuntu terminal pathname is too long

Open the .bashrc file

Enter in the terminal: vi ~/.bashrc (or vim ~/.bashrc if vim is installed)


At the end of the file, add

export PS1='[\u@\h \w]$ '


in,

\u means the current username

\h represents the current hostname (hostname)

\w means the current path


In fact, it can also be reduced to a shorter one and only keep the current path, as follows

export  PS1= '[\w]$ '




Save and exit, and restart the terminal.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325890773&siteId=291194637