grep을 쓰다 보면 matching된 부분의 위 또는 아래 몇 줄을 더 출력해서 봐야할 때가 있다.
그럴 때, 유용하다.
A, B, C 옵션을 아래와 같이 사용하면 N줄이 출력된다.
grep -A N -B N -C N
A는 뒤로 N줄
B는 앞의 N줄
C는 앞,뒤로 N줄
-B, --before-context=NUM print NUM lines of leading context
-A, --after-context=NUM print NUM lines of trailing context
-C, --context=NUM print NUM lines of output context
'What I Do > 프로그래밍' 카테고리의 다른 글
keras에서 layer의 weight를 업데이트하지 않고 고정하기 (0) | 2023.01.26 |
---|---|
ValueError: too many values to unpack (expected 2) request.post(data=params) (0) | 2023.01.17 |
pandas] DataFrame vs. Series (0) | 2023.01.17 |
Java script 아마추어 (0) | 2022.11.14 |