误删树命令如何恢复
考察rpm,百胜的用法
一、删除树命令,树命令不可用
[root@centos7 ~] #这树
/usr/bin/树(root@centos7 ~) # rm - f/usr/bin/tree
root@centos7 ~ #树。
bash:树:命令没有找到…
二,直接百胜或rpm安装将提示树已经安装
[root@centos7 ~] # yum安装树
加载插件:fastestmirror, langpacks
从缓存加载镜像速度hostfile
-
<李>基础:mirror.bit.edu.cn 李>
<李>附加:mirrors.tuna.tsinghua.edu.cn 李>
<李>更新:mirrors.tuna.tsinghua.edu.cn
基地| 3.6 kB就是
附加| 3.4 kB就是
nginx | 2.9 kB就是
更新| 3.4 kB就是
- 1.6.0 - 10. el7包树。x86_64已经安装和最新版本
无关(root@centos7 ~) # rpm -ivh/misc/cd/包/树- 1.6.0 el7.x86_64——10.。rpm
准备……# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # (100%)
- 1.6.0 - 10. el7包树。x86_64已经安装
三,解决办法:强制覆盖安装
[root@centos7 ~] # rpm——帮助
replacepkgs重新安装包是否已经存在
[root@centos7 ~] # rpm -ivh/misc/cd/包/树- 1.6.0 el7.x86_64——10.。rpm——replacepkgs
准备……# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # (100%)
更新/安装…
1: tree-1.6.0-10。el7 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # (100%)
四,此时的树已经可以使用
root@centos7 ~ #树。- d
。
├──桌面
├──文件
├──下载
├──音乐
├──图片
├──公共
├──脚本
├──模板
└──视频李>
五9目录,百胜的话可以重新安装
[root@centos7 ~] #百胜——帮助
重新安装安装包
[root@centos7 ~] # rm - f/usr/bin/tree
root@centos7 ~ #树- d。
bash:/usr/bin/tree:没有这样的文件或目录
[root@centos7 ~] # yum安装树- y
root@centos7 ~ #树- d。
。
├──桌面
├──文件
├──下载
├──音乐
├──图片
├──公共
├──脚本
├──模板
└──视频
六9目录,当然还可以找到树的rpm包,使用rpm2cpio和cpio id解压包,并将树命令移回到原来的位置