Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- OpenCV
- pandas
- C++
- Docker
- pytorch
- 오류
- C#
- YOLO
- Numpy
- 핑거스타일
- ubuntu
- 채보
- windows forms
- Selenium
- nvidia-smi
- SSH
- label
- pip
- Visual Studio
- Linux
- error
- C
- JSON
- 컨테이너
- mysql
- paramiko
- 프로그래머스
- 기타 연주
- Python
- VS Code
Archives
- Today
- Total
기계는 거짓말하지 않는다
Linux 파일, 디렉터리 검색 find 명령어 본문
find(1) - Linux man page
find(1) - Linux man page Name find - search for files in a directory hierarchy Synopsis find [-H] [-L] [-P] [-D debugopts] [-Olevel] [path...] [expression] Description This manual page documents the GNU version of find. GNU find searches the directory tree
linux.die.net
다음은 간단한 사용 예이다.
find "*.mp4" # 현재 경로의 모든 mp4 파일, 디렉터리 검색 find . -name "*.mp4" # 현재 경로와 현재 경로 하위의 모든 mp4 파일, 디렉터리 검색 find . / -name "*.mp4" # 최상위 경로와 최상위 경로 하위의 모든 mp4 파일, 디렉터리 검색 find . -perm 0777 # 현재 경로와 현재 경로 하위의 0777 권한 파일, 디렉터리 검색
find와 xargs, grep을 사용하여 검색어가 파일 내부에 포함되었는지 확인도 가능하다.
# 현재 경로와 현재 경로 하위의 모든 txt 파일에서 ABCD가 txt 파일 내용에 포함된 파일을 찾는다. find . -type f -name "*.txt" | xargs grep "ABCD"
'Linux' 카테고리의 다른 글
Ubuntu apt update GPG error (0) | 2023.03.11 |
---|---|
Ubuntu Nouveau 비활성화 (NVIDIA Driver Setup) (0) | 2023.03.11 |
Ubuntu 한글 설정 (locale) (0) | 2023.02.25 |
Ubuntu 20.04 LTS OpenCV 4.2.0 설치 (0) | 2023.02.18 |
Ubuntu Timezone 설정 (한국 시간) (0) | 2023.02.18 |