
좀 더 구체적으로 표시하고 싶습니다.출력의 파일 내용find
명령,다음 명령을 시도했지만 작업이 완료되지 않습니다.
cat < find . -name "*.txt"
find . -name "*.txt" | cat
답변1
어느 하나
find . -name "*.txt" | xargs cat --
또는 (GNU가 있는 경우 더 좋음 find
)
find . -name "*.txt" -print0 | xargs -0 cat --
또는
find . -name "*.txt" -exec cat -- {} +
답변2
아래 명령을 사용하여 파일 내용을 표시할 수 있습니다.
방법 1:
find . -type f -iname "*.txt" -exec cat {} \;
방법 2:
ls -ltr *.txt | awk '{print "cat" " " $9}' | sh