일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- Oracle VM VirtualBox
- 리눅스
- putty
- PYTHON
- dbeaver
- csharp
- C#
- Algorithm
- RFP
- 파이썬 전처리
- 파이썬 데이터프레임
- VirtualBox
- HTML
- 코딩테스트
- MariaDB
- Python DataFrame
- 오라클
- 알고리즘
- Python 라이브러리
- it 용어
- 데이터베이스
- sql
- tibero
- Oracle
- 리눅스 명령어
- linux
- python algorithm
- it용어
- 파이썬 알고리즘
- 파이썬
- Today
- Total
오경석의 개발노트
Linux_tree 본문
■ tree : 파일과 디렉터리를 트리 형태로 출력🌳
■ 설치
yum -y install tree # 리눅스 내장 명령어가 아니므로 초기에 설치 필요
■ 구조
tree [OPTION] 디렉터리경로
■ 옵션
● -d : 디렉터리만 표시
● -f : 파일의 전체 경로 표시
● -df : 전체 경로까지 표함된 서브디렉터리 표시
● -a : 숨겨진 파일까지 표시
● -L : 표시할 디렉터리 단계 표시(ex. tree -L 3)
● -u : 사용자 이름(UID) 표시
● -g : 그룹 이름(GID) 표시
● -p : 파일 권한 표시
● -P : 와일드카드 패턴에 맞는 파일 표시
● -I : 특정 디렉터리 제외(대문자 i)
● -h : 파일 및 디렉터리 용량 사람이 읽기 쉽게 단위로 표시
● -s : 파일 및 디렉터리 용량 byte 표시
● -D : 마지막으로 수정한 시각 표시
● --prune : 빈 디렉터리는 결과에서 제외
● --du : 각 서브디렉터리의 크기를 그에 속한 모든 파일과 서브디렉터리를 합산해 표시
등등
■ 예시
- 옵션을 사용하지 않으면 현재 위치에 대한 폴더 및 파일 구조 확인 및 하단에 폴더/파일 수 출력
[root@TEST test]# tree
.
├── sample
│ └── fds.txt
└── sample2
1 directory, 2 files
[root@TEST test]# tree -d
.
└── sample
1 directory
[root@TEST test]# tree -f
.
├── ./sample
│ └── ./sample/fds.txt
└── ./sample2
1 directory, 2 files
[root@TEST test]# tree -df
.
└── ./sample
1 directory
[root@TEST test]# tree -L 1
.
├── sample
└── sample2
1 directory, 1 file
[root@TEST test]# tree -fL 1
.
├── ./sample
└── ./sample2
1 directory, 1 file
[root@TEST test]# tree -fI 'sample'
.
└── ./sample2
0 directories, 1 file
[root@TEST test]# tree -p
.
├── [drwxr-xr-x] sample
│ └── [-rw-r--r--] fds.txt
└── [-rw-r--r--] sample2
1 directory, 2 files
[root@TEST test]# tree -pug
.
├── [drwxr-xr-x root user2 ] sample
│ └── [-rw-r--r-- root user1 ] fds.txt
└── [-rw-r--r-- root user2 ] sample2
1 directory, 2 files
[root@TEST test]# tree -P *t*
.
└── sample
└── fds.txt
1 directory, 1 file
[root@TEST test]# tree -D
.
├── [Jan 15 4:00] sample
│ └── [Jan 15 4:00] fds.txt
└── [Jan 15 4:36] sample2
1 directory, 2 files
출처 : https://velog.io/@eunjeong/TIL-CentOS-tree-%EB%AA%85%EB%A0%B9%EC%96%B4
[TIL] CentOS tree 명령어
파일과 디렉토리를 트리 형태로 출력\-d : 디렉토리만 표시\-f : 파일의 전체 경로 표시\-df : 전체경로까지 포함된 서브디렉토리 표시\-a : 숨겨진 파일까지 표시\-L : 표시할 디렉터리 단계 표시\-p :
velog.io
출처 : https://antilibrary.org/2364
초보자를 위한 리눅스 tree 명령어 사용법 Linux ‘tree Command’ Usage Examples for Beginners
Photo by Johannes Plenio from Pexels tree 는 디렉토리를 리스팅하거나 컨텐츠 내용을 볼 때 사용할 수 있는 간단한 명령어이다. 디렉토리 경로와 서브디렉토리내의 파일, 그리고 서브디렉토리와 파일의
antilibrary.org
'소프트웨어, 운영체제 > Linux' 카테고리의 다른 글
Linux_scp 명령어로 서버 간 파일 전송 (0) | 2024.02.12 |
---|---|
Linux_ssh로 서버 간 접속 (0) | 2024.02.11 |
Linux_chgrp(change group) (1) | 2024.01.15 |
Linux_chmod(change mode) (1) | 2024.01.14 |
Linux_chown(change the owner of a file) (1) | 2024.01.08 |