Linux
-
Linux append text filesJust Programming 2021. 10. 25. 17:51
linux bash에서 텍스트 파일을 합치는 명령어 요구되는 기능들 아래의 코드를 만들기 위해서는 2개의 기능이 필요하다. 문자 이어 붙이기 stackoverflow how-to-append-one-file-to-another-in-linux-from-the-shell 여러개의 파일 선택하기 use wildcard stackexchange how-do-i-copy-multiple-files-by-wildcard for file in file*; do cat "$file" >> "./result.txt"; done # chmod +x ./.sh 결론 하지만 더 쉬운 방법이 있다. ls [파일명패턴] | xargs cat > [결과파일명] 쉘 명령어로 이거 써도 되더라 전체 파일 cat으로 보내는걸 파일에 ..