- remove blank lines with grep
- grep 빈 줄 제외
- grep 공백 줄 제거
- grep 주석 + 공백 제외
1 방법[ | ]
아무것도 없는 빈줄 제외
Bash
Copy
cat 파일명 | grep -v ^$
Bash
Copy
grep -e "^$" -v 파일명
공백문자 있는 줄까지 제외
Bash
Copy
cat 파일명 | egrep -v ^[[:space:]]*$
#으로 시작하는 줄까지 제외
Bash
Copy
cat 파일명 | egrep -v '^[[:space:]]*(#.*)?$'
2 같이 보기[ | ]
3 참고[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.