Home > System Tutorial > LINUX > body text

How to solve the problem of accidentally deleting the /root directory in CentOS?

王林
Release: 2024-01-07 16:06:56
forward
876 people have browsed it

During testing, I accidentally deleted centos/root using rm -rf

Delete the /root directory, the system will not crash, and it can start normally, but it just looks unpleasant!

Solution:

1. Create the /root directory directly; mkdir /root

2. Copy the hidden files under /etc/skel/ to the /root directory; cp /etc/skel/.bash* /root

3. Restart

4. Be careful when using rm -rf in the production environment. It is best to test it in the test environment to make sure there are no problems before using it! ! !

The above is the detailed content of How to solve the problem of accidentally deleting the /root directory in CentOS?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!