%EC%9D%98%20%EB%AA%A8%EB%93%A0%20%ED%8C%8C%EC%9D%BC%20%EB%AA%A9%EB%A1%9D%EC%9D%84%20%EC%96%BB%EB%8A%94%20%EB%B0%A9%EB%B2%95.png)
파일 이름에 "가 포함된 디렉터리 및 하위 디렉터리에서 파일 목록을 검색하고 싶습니다.정보-" 또는"안전한". 다음 명령을 사용해 보았지만 해당 하위 디렉터리에서 파일을 읽을 수 없습니다.
find /u01 -maxdepth 1 -name "*message-*"
find . -name "*message-*"
find /u01 -type f -printf '%s %p\n' | sort -nr | head -20 | find -maxdepth 1 -name "*message-*" -a -name "*secure*"
이 문제를 해결하는 데 도움을 주실 수 있나요?
답변1
나는 다음과 같은 것을 사용한다고 생각합니다.
find . -type f -iname "*message-*" -o -iname "*secure*"
답변2
다음 명령이 나에게 효과적이었습니다.
find /u01 -type f \( -name "*message*" -o -name "*secure*" \) -type f -printf '%s %p\n'
이름에 이 두 문자열이 포함된 상위 20개의 가장 큰 파일을 가져옵니다.
find /u01 -type f \( -name "*message*" -o -name "*secure*" \) -type f -printf '%s %p\n' | sort -nr | head -20