记Linux rm -f /* 如何解决

服务器不小心执行了 rm -f /*,尴尬,本来我想执行的是rm -f ./*   删除当前目录下的文件的

[root@mha app1]# rm -f /*
rm: cannot remove ?.backup_dir?. Is a directory
rm: cannot remove ?.boot?. Is a directory
rm: cannot remove ?.data?. Is a directory
rm: cannot remove ?.data1?. Is a directory
rm: cannot remove ?.data2?. Is a directory
rm: cannot remove ?.data3?. Is a directory
rm: cannot remove ?.dev?. Is a directory
rm: cannot remove ?.etc?. Is a directory
rm: cannot remove ?.home?. Is a directory
rm: cannot remove ?.lost+found?. Is a directory
rm: cannot remove ?.media?. Is a directory
rm: cannot remove ?.mnt?. Is a directory
rm: cannot remove ?.opt?. Is a directory
rm: cannot remove ?.proc?. Is a directory
rm: cannot remove ?.root?. Is a directory
rm: cannot remove ?.run?. Is a directory
rm: cannot remove ?.srv?. Is a directory
rm: cannot remove ?.sys?. Is a directory
rm: cannot remove ?.tmp?. Is a directory
rm: cannot remove ?.usr?. Is a directory
rm: cannot remove ?.var?. Is a directory
[root@mha app1]# ll ###怎么切换目录都不行
-bash: /usr/bin/ls: /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory

这里尽量保留ssh,不要断了,不然只能去机器上接显示器键盘了。

发现是/lib64不见了,被我删除了,好吧,这是一个软连接,创建软连接,ln也不行,上google找,提示用绝对路径试试。

于是,/usr/sbin/sln /usr/lib64 /lib64。

[root@mha ~]# /usr/sbin/sln /usr/lib64 /lib64
[root@mha ~]# 
[root@mha ~]# 
[root@mha ~]# /usr/sbin/sln /usr/lib /lib
[root@mha ~]# /usr/sbin/sln /usr/bin /bin
[root@mha ~]# /usr/sbin/sln /usr/sbin /sbin
[root@mha ~]# ll
total 950936
-rw-------. 1 root root      1813 May 21 00:13 anaconda-ks.cfg
-rw-r--r--. 1 root root     15264 Sep 18 20:56 epel-release-latest-7.noarch.rpm
-rw-r--r--. 1 root root      1861 May 21 02:05 initial-setup-ks.cfg
-rw-r--r--. 1 root root     81024 May 19  2018 mha4mysql-manager-0.58-0.el7.centos.noarch.rpm
-rw-r--r--. 1 root root     36328 May 19  2018 mha4mysql-node-0.58-0.el7.centos.noarch.rpm
-rw-r--r--. 1 root root 328740156 Jul  4 17:53 mysql-5.6.43-linux-glibc2.12-x86_64.tar.gz
-rw-r--r--. 1 root root 644869837 Jul  6 13:11 mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz

发现ls好使了,所幸没有用到rm -rf,可怕。

你可能感兴趣的:(LINUX成长记)