The command line prefix will disappear when you install some package e.g. Anaconda. There is a way to restore and customize the prefix.

Edit the .bashrc file and append these text:

export PS='[\u]\#'    #\u – Username

export PS='[\h]\#'    #\h – Hostname

export PS='[\w]\#'    #\w – Full path of the current working directory

You can customize the text :

export PS='[\u@\w]\#'

And [root@localhost opt]# can be appeared in your bash.

Last modified: 2020年2月14日


Write a Reply or Comment

Your email address will not be published.