IT Log

[CentOS 7] find... exec 본문

Linux/CentOS 7

[CentOS 7] find... exec

newly0513 2021. 3. 24. 16:31
728x90
반응형

find : 디렉토리 계층구조에서 파일을 검색

 

사용 방법

find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]

 

Actions

Action 설명  
-delete 찾은 파일을 삭제(명령 성공시 true, 실패하면 오류 발생하며 종료상태 값이 0이 아님) / -depth를 명시적으로 지정  
-exec <command> ; command를 실행
지정된 명령은 일치하는 각 파일에 대해 한 번씩 실행 
 
-exec <commnad> {} +    
-execdir <command> ;    
-execdir <command> {} +    
-fls <file> ls -l 과 같은 출력을 file에 저장  
-fprint <file> 경로 출력을 file에 저장  
-fprint() <file> 찾은 파일이 없어도 경로 출력을 file에 저장(출력을 한줄에 입력)   

 

EXPRESSIONS

OPTIONS    
-depth    
     
     
728x90
반응형
Comments