作为一位建筑人,目前尝试着在Linux的道路上探索新的发展级。
今天无意中发现自己的centos没有tree命令,有点不解。也问了度娘,看到的是这样的答案:
sudo apt-get install tree
输进去,不对啊:

后来一想,原来ubuntu系统中默认是没有tree这个命令的,需要安装,用下面的命令就可以安装tree这个命令工具sudo apt-get install tree
CentOS使用yum -y install tree
好了,尝试在centos中进行“yum -y install tree”命令操作

不行!
那么我们转换思路,我想通过导入源代码来实现我的目的。
我们都知道Linux中很多东西都是通过文件来实现的,命令也不例外。
首先我们需要借助这个平台,下载我们想要的东西。
ftp://mama.indstate.edu/linux/tree/
我选择的是(最下面那一个):

下载到桌面以后,拖动到我们的centos终端中。通过 tar -zxvf命令来解压到文件夹中:

通过ls命令查看文件夹内的信息:

很开心,tree-1.7.0俨然在列。但是在上一张图片我犯了一个错误,很多新手可能会犯的:你直接make,make 什么东西呢?你不列出来Linux再聪明也不知道呀。你cd,cd自己的话Linux肯定也不知道了。正确的方式是:

先cd tree,然后再make,linux 就会知道了。然后把tree复制到/bin中,最后执行tree命令,美丽的tree树就展现在你的面前了。

提高贵在点滴积累,新手们,加油!