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

Jmnote (토론 | 기여)님의 2020년 6월 3일 (수) 10:49 판 (새 문서: ==개요== ;리눅스 여러 줄 출력을 한줄로 만들기 <source lang='console'> root@localhost:~# cat a.txt hello world lorem ipsum </source> {{소스헤더|스페이스 구...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

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 }}