리눅스 sed 구간 삭제

1 개요[ | ]

리눅스 sed 구간 삭제
sed '/시작문자열/,/종료문자열/d' 파일명

2 실행 예시[ | ]

  • 예제 파일 hello_test.sh
echo Hello.
#### test
# some comment
echo This is Test.
#### test end
echo World.
root@zetawiki:~# sed '/#### test/,/#### test end/d' hello_test.sh 
echo Hello.
echo World.
root@zetawiki:~# sed '/#### test/,/#### test end/d' hello_test.sh > hello_prod.sh
root@zetawiki:~# sh hello_test.sh 
Hello.
This is Test.
World.
root@zetawiki:~# sh hello_prod.sh 
Hello.
World.

3 같이 보기[ | ]

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