사용자 도구

사이트 도구


linux:find

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
마지막 판 양쪽 다음 판
linux:find [2016/08/08 15:45]
kwon37xi [특정 시점 이후/이전 수정된 파일]
linux:find [2016/08/08 16:05]
kwon37xi
줄 57: 줄 57:
 <code sh> <code sh>
 find */ | cut -d/ -f1 | uniq -c find */ | cut -d/ -f1 | uniq -c
 +</code>
 +
 +===== 특정 날짜의 모든 로그 파일들 중에서 grep =====
 +로그 파일이 한 날짜에 굉장히 많을 때(예: Jenkins build log) 특정 날짜의 로그 파일만 찾아서 거기서 특정 문자열 검색
 +  * [[http://stackoverflow.com/questions/158044/how-to-use-find-to-search-for-files-created-on-a-specific-date|bash - How to use 'find' to search for files created on a specific date?]]
 +  * [[http://virtuelvis.com/2008/10/how-to-use-find-to-search-for-files-created-on-a-specific-date/|» How to use ‘find’ to search for files created on a specific date Arve Bersvendsen]]
 +<code sh>
 +# 날짜 기준이 생성일이라고  할 때, 첫 날짜는 검색하고자 하는 날짜, 두번째는 검색하고자 하는 다음날 날짜
 +find . -name *.log -newerct yyyy-MM-dd ! -newerct yyyy-MM-dd -exec grep -Hni '검색어' {} \;
 </code> </code>
  
linux/find.txt · 마지막으로 수정됨: 2020/09/17 12:06 저자 kwon37xi