#1 安装相关的依赖包
[root@centos7 ~]#yum install gcc make
#2 下载源码并解压
[root@centos7 ~]#cd /usr/local/src
[root@centos7 src]#tar xvf tree-1.8.0.tgz
#3 进入解压缩的目录,README和INSTALL
[root@centos7 tree-1.8.0]#cd tree-1.8.0/
[root@centos7 tree-1.8.0]#cat README
[root@centos7 tree-1.8.0]#cat INSTALL
#4 修改源码的版本号
[root@centos7 tree-1.8.0]#grep -R ‘v1.8.0’ *
tree.c:static char *version ="$Version: $ tree v1.8.0 © 1996 - 2018 by Steve
Baker, Thomas Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro KaTeX parse error: Undefined control sequence: \t at position 34: …har *hversion="\̲t̲\t tree v1.8.0 …Version: $ tree v2.88.99 © 1996 - 2018 by Steve Baker,
Thomas Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro KaTeX parse error: Undefined control sequence: \t at position 27: …har *hversion="\̲t̲\t tree v2.88.9…PATH:/apps/tree/bin’ > /etc/profile.d/tree.sh
[root@centos7 ~]#. /etc/profile.d/tree.sh
[root@centos7 ~]#echo KaTeX parse error: Expected 'EOF', got '#' at position 121: …root@centos7 ~]#̲tree --version …PATH’ > /etc/profile.d/tree.sh
[root@centos7 ~]#. /etc/profile.d/tree.sh
[root@centos7 ~]#exit
[root@centos7 ~]#echo $PATH
/apps/tree/bin:/usr/lib64/qt-
3.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
#10 验证结果
[root@centos7 ~]#tree --version
tree v2.88.99 © 1996 - 2018 by Steve Baker, Thomas Moore, Francesc Rocher,
Florian Sesser, Kyosuke Tokoro
[root@centos7 ~]#tree -J
[{“type”:“directory”,“name”: “.”,“contents”:[
{“type”:“file”,“name”:“anaconda-ks.cfg”},
范例:编译安装cmatrix
{“type”:“file”,“name”:“initial-setup-ks.cfg”}
]},
{“type”:“report”,“directories”:0,“files”:2}
]
[root@centos7 ~]#tree -X
tree的编译安装练习
最新推荐文章于 2023-03-18 16:38:22 发布