tree는 리눅스 명령어로 아래와 같이 폴더의 계층 구조를 트리 형태로 출력해주는 명령어이다.
tree 명령어는 직접 설치해서 사용해야하는데 Homebrew를 사용하면 간단하게 설치할 수 있다.
brew install tree
설치 완료 후, tree 명령어를 사용하면 현재 경로에서 폴더의 계층 구조를 트리로 출력해준다!
물론 특정 디렉토리 경로도 출력 가능하다
tree [디렉토리 경로]
내가 만난 에러
>Updating Homebrew...
>fatal: Could not resolve HEAD to a revision
>Warning: No available formula or cask with the name "tree".
>==> Searching for similarly named formulae...
>Error: No similarly named formulae found.
>==> Searching for a previously deleted formula (in the last month)...
>Error: No previously deleted formula found.
>==> Searching taps on GitHub...
>Error: No formulae found in taps.
Homebrew가 잘못 설치되어 나타난 에러였다!
brew doctor
를 해보고 다음과 같은 메시지가 나왔다면 재설치하고 다시 시도해보자
Warning: Some taps are not on the default git origin branch and may not receive updates. If this is a surprise to you, check out the default branch with:
git -C $(brew --repo homebrew/core) checkout master
참고로 아래는 재설치할 때 참조한 포스팅이다
https://www.lainyzine.com/ko/article/how-to-install-homebrew-for-m1-apple-silicon/
재설치하고 다시 brew install tree
하면 정상적으로 ✨tree✨가 출력되는 것을 확인할 수 있다.