"리눅스 문자열 매칭 행번호 확인"의 두 판 사이의 차이

1번째 줄: 1번째 줄:
;match string and get line number
;get line number of first matching
;get line number of first matching
;리눅스 첫번째 매칭 행번호 확인
;리눅스 첫번째 매칭 행번호 확인
;get line number of last matching
;get line number of last matching
;리눅스 마지막 매칭 행번호 확인
;리눅스 마지막 매칭 행번호 확인

2012년 7월 11일 (수) 13:51 판

match string and get line number
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 }}