日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux如何删除tree命令,误删tree命令如何恢复

發(fā)布時(shí)間:2023/12/31 linux 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux如何删除tree命令,误删tree命令如何恢复 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

誤刪tree命令如何恢復(fù)

考察rpm,yum的用法

一、刪除tree命令,tree命令不可用

[root@centos7 ~]# which tree

/usr/bin/tree

[root@centos7 ~]# rm -f /usr/bin/tree

[root@centos7 ~]# tree .

bash: tree: command not found...

二、直接yum或rpm安裝將提示tree已經(jīng)安裝

[root@centos7 ~]# yum install tree

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

base: mirror.bit.edu.cn

extras: mirrors.tuna.tsinghua.edu.cn

updates: mirrors.tuna.tsinghua.edu.cn

base | 3.6 kB 00:00:00

extras | 3.4 kB 00:00:00

nginx | 2.9 kB 00:00:00

updates | 3.4 kB 00:00:00

Package tree-1.6.0-10.el7.x86_64 already installed and latest version

Nothing to do

[root@centos7 ~]# rpm -ivh /misc/cd/Packages/tree-1.6.0-10.el7.x86_64.rpm

Preparing... ################################# [100%]

package tree-1.6.0-10.el7.x86_64 is already installed

三、解決辦法:強(qiáng)制覆蓋安裝

[root@centos7 ~]# rpm --help

--replacepkgs reinstall if the package is already present

[root@centos7 ~]# rpm -ivh /misc/cd/Packages/tree-1.6.0-10.el7.x86_64.rpm --replacepkgs

Preparing... ################################# [100%]

Updating / installing...

1:tree-1.6.0-10.el7 ################################# [100%]

四、此時(shí)的tree已經(jīng)可以使用

[root@centos7 ~]# tree . -d

.

├── Desktop

├── Documents

├── Downloads

├── Music

├── Pictures

├── Public

├── scripts

├── Templates

└── Videos

9 directories

五、yum的話可以重新安裝

[root@centos7 ~]# yum --help

reinstall reinstall a package

[root@centos7 ~]# rm -f /usr/bin/tree

[root@centos7 ~]# tree -d .

-bash: /usr/bin/tree: No such file or directory

[root@centos7 ~]# yum reinstall tree -y

[root@centos7 ~]# tree -d .

.

├── Desktop

├── Documents

├── Downloads

├── Music

├── Pictures

├── Public

├── scripts

├── Templates

└── Videos

9 directories

六、當(dāng)然還可以找到tree的rpm包,使用rpm2cpio和cpio -id解壓包,并將tree命令移回到原來的位置

總結(jié)

以上是生活随笔為你收集整理的linux如何删除tree命令,误删tree命令如何恢复的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。