The tree command lists the structure of the file directory as a graph. However some Linux (Centos 6.4) does not have a tree command, this article describes the installation method.
Common parameters:
TREE-D displays only the directory. Tree-l 1 Displays only the first-level directory. [Email protected] tree-1.7.0]# Tree-bash:tree:command not found
Install the tree command:
[[email protected] Download]# Tree-bash:tree:command not found to ftp://mama.indstate.edu/linux/tree/download the latest Tree command source code compression package. [[email protected] Download]# ls-l tree-1.7.0.tgz-rw-rw-r--. 1 LFZ LFZ 47082 June 8 07:36 tree-1.7.0.tgz[[email protected] Download]# tar zxf tree-1.7.0.tgz[[email protected] Download]# CD tree-1.7 .0[[email protected] tree-1.7.0]# lschanges INSTALL LICENSE Makefile man README strverscmp.c tree.c[[email protected] Tree -1.7.0]# makegcc-ggdb-wall-dlinux-d_largefile64_source-d_file_offset_bits=64-c-o tree.o tree.cgcc-o tree tree.o
<!--If you are prompted with this step: do gcc command not found?
The first thing to consider is whether these environment variables are already included in Root $path.
Mainly these four:/bin,/usr/bin,/sbin,/usr/sbin.
The/bin:bin for binary is mainly to place some of the system's essential executable files such as: Cat, CP, chmod DF, DMESG, gzip, kill, LS, mkdir, more, Mount, RM, Su, tar, etc. /usr/bin: Some of the essential executable files for application software tools such as C + +, g++, GCC, Chdrv, diff, Dig, Du, eject, elm, free, gnome*, gzip, htpasswd, KFM, Ktop, Last, Less, Locale, M4, make, man, Mcopy, NcFTP, newaliases, nslookup passwd, quota, smb*, wget, etc. /sbin: There are some essential programs for system management such as Cfdisk, DHCPCD, Dump, E2FSCK, Fdisk, Halt, Ifconfig, Ifup, Ifdown, Init, Insmod, Lilo, Lsmod, MKE2FS, Modprobe, Quotacheck, reboot, Rmmod, runlevel, shutdown, etc. /usr/sbin: Some essential programs for network management such as: DHCPD, HTTPD, IMAP, IN.*D, inetd, LPD, named, Netconfig, NMBD, samba, sendmail, squid, swap, TCPD , Tcpdump and so on. You can view the. Bash_profile path in the home directory. if: path= $PATH: $HOME/bin needs to be added as follows: path= $PATH: $HOME/bin:/sbin:/usr/bin:/usr/sbin.
Set up, still prompt command cannot be found,
Cause: The GCC compiler is not installed
Solution: Yum install-y gcc g++ gcc-c++ make-->[[email protected] tree-1.7.0]# CP-AF tree/usr/bin Example: [[email protected] Download]# tree-l 1.├──tree-1.7.0└──tree-1.7.0.tgz1 directory, 1 file
Attached: source code for tree command <a>ftp://mama.indstate.edu/linux/tree/</a>
Tree-List The contents of a directory in trees