IT/SpringBoot&AWS

AWS EC2 에 tree 설치하기

_하늘여우_ 2022. 5. 15. 14:55

출처 : unsplash

 

What is a Tree?

- tree 명령어는 디렉토리 내 파일을 트리 형식으로 보여주는 명령어이다.

- ls 명령어도 디렉토리 내 파일을 보여주지만, tree 명령어는 구조화된 리스트로 시각화하여 보여주기 때문에 유용하다.

 

How to install tree on linux?

1. 확인

[ec2-user@ip-xxx-xx-xx-xx ~]$ tree
-bash: tree: command not found

 

2. 설치

[ec2-user@ip-xxx-xx-xx-xx ~]$ sudo yum install tree
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core                                                                                                                                             | 3.7 kB  00:00:00     
amzn2extra-docker                                                                                                                                      | 3.0 kB  00:00:00     
amzn2extra-kernel-5.10                                                                                                                                 | 3.0 kB  00:00:00     
Resolving Dependencies
--> Running transaction check
---> Package tree.x86_64 0:1.6.0-10.amzn2.0.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================================
 Package                             Arch                                  Version                                            Repository                                 Size
==============================================================================================================================================================================
Installing:
 tree                                x86_64                                1.6.0-10.amzn2.0.1                                 amzn2-core                                 47 k

Transaction Summary
==============================================================================================================================================================================
Install  1 Package

Total download size: 47 k
Installed size: 83 k
Is this ok [y/d/N]: y
Downloading packages:
tree-1.6.0-10.amzn2.0.1.x86_64.rpm                                                                                                                     |  47 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : tree-1.6.0-10.amzn2.0.1.x86_64                                                                                                                             1/1 
  Verifying  : tree-1.6.0-10.amzn2.0.1.x86_64                                                                                                                             1/1 

Installed:
  tree.x86_64 0:1.6.0-10.amzn2.0.1                                                                                                                                            

Complete!

 

3. 설치 확인

[ec2-user@ip-xxx-xx-xx-xx ~]$ tree --version
tree v1.6.0 (c) 1996 - 2011 by Steve Baker, Thomas Moore, Francesc Rocher, Kyosuke Tokoro

 

4. 예시

[ec2-user@ip-xxx-xx-xx-xx step2]$ tree
.
├── freelec-springboot2-webservice-1.0.0-SNAPSHOT-20220514081234.jar
├── freelec-springboot2-webservice-1.0.0-SNAPSHOT-20220514081644.jar
├── nohup.out
└── zip
    ├── appspec.yml
    ├── deploy.sh
    └── freelec-springboot2-webservice-1.0.0-SNAPSHOT-20220514081644.jar

1 directory, 6 files

 

끝~