Get the App
SLTechnology News&Howtos  ›  Servers  › 

Linux Command prompt appears-- the solution of bash-4.2#

Shulou Source: shulou.com Published: 2022-06-02 21:35:26 09月22日 Update

One day last week, when the configuration entered the Linux system, the system command prompt suddenly became a message of # bash-4.2# instead of a message of root hostname + path. I didn't know why this happened for a long time. Later, after looking up a lot of information on the Internet, I finally solved this problem because several configuration files of root under / root were lost. That's why root users become bash-4.2#, and the missing files are-- 1. Bash _ profile,2. Bashrc these files are necessary for every user.

Cp / etc/skel/.bashrc / root/

Cp / etc/skel/.bash_profile / root/

Use one of the two commands above to re-copy a copy to the / root directory, then log out of the root user, and log in again to return to normal.

Tags: File user command prompt information system face configuration prompt host reason that is copy status directory data path problem Zhou login Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei MariaDB OPPO Reno Xiaomi macOS