리눅스 문자열 매칭 행번호 확인

Jmnote (토론 | 기여)님의 2012년 7월 11일 (수) 13:50 판
get line number of first matching
리눅스 첫번째 매칭 행번호 확인
get line number of last matching
리눅스 마지막 매칭 행번호 확인

1 첫번째 매칭

grep -n 문자열 파일 | head -1 | cut -d ":" -f 1

2 마지막 매칭

3 같이 보기

4 참고 자료

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