Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report