리눅스 여러 줄 출력을 한줄로 만들기

Jmnote (토론 | 기여)님의 2020년 12월 21일 (월) 11:50 판 (→‎같이 보기)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

리눅스 여러 줄 출력을 한줄로 만들기
root@localhost:~# cat a.txt
hello
world
lorem
ipsum
스페이스 구분자
root@localhost:~# cat a.txt | xargs echo
hello world lorem ipsum
쉼표 구분자
root@localhost:~# cat a.txt | xargs echo | sed 's/ /,/g'
hello,world,lorem,ipsum
구분자 없음
root@localhost:~# cat a.txt | xargs echo | sed 's/ //g'
helloworldloremipsum


2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}