-
디렉토리 구조 출력하고 싶을 때.etc 2021. 11. 6. 12:09
다음과 같이 디렉토리의 구조를 출력해서 보여주고 싶을 때,
📦App ├── 🗂backend │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── com └── 🗂frontend └── src ├── images ├── index.css ├── index.js └── App.js
맥이라면 tree를 설치해서보여줄 수 있다.
brew install tree
tree -help 를 치면 사용법을 확인할 수 있고,
해당 프로젝트 디렉토리로 가서 tree를 누르면 모든 파일에 대한 구조를 확인할 수 있다.
특정 깊이만큼 (ex)디렉토리 -> 하위디렉토리 1단계로 하고 싶을때)
tree -L 1
📦App ├── 🗂backend └── 🗂frontend
디렉토리만 출력하고 싶을 때
tree -d
📦App ├── 🗂backend │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── com └── 🗂frontend └── src
특정디렉토리를 제외하고 출력하고 싶을 때
tree -I "main"
📦App ├── 🗂backend │ ├── src └── 🗂frontend └── src ├── images ├── index.css ├── index.js └── App.js
여러개의 디렉토리를 제외하고 출력하고 싶을 때
tree -I 'main|src'
📦App ├── 🗂backend └── 🗂frontend
해당 단어를 포함한 디렉토리를 제외하고 출력하고 싶을 때 (LIKE)
tree -I 'ma*|src'
📦App ├── 🗂backend └── 🗂frontend
(참고한 사이트)
https://m.blog.naver.com/foxez/221411283235
tree: ignore directories with patterns
https://zaiste.net/tree_ignore_directories_with_patterns/ tree 명령어를 이용해서 폴더 구조를 프린트...
blog.naver.com
https://gloriajun.github.io/os/2017/03/31/os-mac-terminal-tree.html
L.E.T
Learned! Experience! Think!
gloriajun.github.io
'.etc' 카테고리의 다른 글
인텔리제이에서 최상단 호출부 hierarchy 확인하는 방법 (0) 2025.05.04 class file has wrong version 61.0, should be 59.0 예외 발생 (0) 2024.02.16 케이스 스타일 (Camel case, Kebab case, Snake case, Pascal case) (2) 2021.12.30 idpiframe initialization failed 에러 발생 시 (0) 2021.11.06 Heroku 배포중에 Process exited with status 143 오류 발생시 (0) 2021.11.06