본문 바로가기

전체 글

grep 시 원하는 문자열이 포함된 위아래줄 출력 grep -C 1 SocketException catalina.out-20150314 참고로 특정문자가 미포함된 라인 검색은 옵션을 -v 로 주면 된다. 더보기
grep 할 때 Binary file (standard input) matches 나올 시 grep 방법 grep 명령어 사용 시 Binary file (standard input) matches 혹은 Binary file (표준 입력) matches 이 나오는 이유는 많은 이유가 있겠지만 내 경우는 binary 파일이어서 안되던 경우였다. -a 옵션을 붙이면 텍스트로 읽어서 grep을 사용 할 수 있다. ex) cat test.log | grep -a IF-asdf-001 이런식으로 -a 옵션을 붙이면 가능하다 !! 더보기
egrep 예제 cat file.log | grep test | egrep 18:[0-5][0-9]:[0-5][0-9] -c file.log 파일에서 test라는 문자열을 검색하는데 egrep 뒤에 정규식을 통해 18:0~5,0~9:0~5,0~9 가 몇개 있는지 확인 18:00:00부터 19:59:59까지 몇개인지 카운팅 하는 법 더보기
mac osX 하나의 앱을 여러개 실행하는 법 터미널에서 open -n [appName].[확장자] ex) open -n VLC.app open -na [appName]ex) open -n VLC 더보기
Activemq 정리 잘된 페이지 http://download.progress.com/5331/open/adobe/prc/psc/perf_tuning_activemq/index.htm 다운로드아님. 플래시 페이지... 더보기
log4j pattern layout 설정 값 %a - Remote IP address %A - Local IP address %b - Bytes sent, excluding HTTP headers, or '-' if zero %B - Bytes sent, excluding HTTP headers %h - Remote host name (or IP address if resolveHosts is false) %H - Request protocol %l - Remote logical username from identd (always returns '-') %m - Request method (GET, POST, etc.) %p - Local port on which this request was received %q - Query string (pr.. 더보기
폴더 용량 확인하는 법 du [option] [folder name] ex1) du test 폴더안에 있는 파일들의 용량이 리스트로 나온다. ex2) du -s test 폴더의 용량을 나타낸다. 기본단위는 kbyte. ex3) du -sh test 폴더의 용량을 나타낸다. 이때는 mbyte 그이상이면 gbyte 로 표현된다. 더보기
catalina.out파일 lotate 시키기 /etc/logrotate.d/ 폴더에 파일 생성 ex) vim /etc/logrotate.d/tomcat #!/bin/bash # SWU Tomcat Log Daily truncate and rotate /svc/tomcat/was/tomcat-7.0.54/logs/catalina.out{ copytruncate daily rotate 30 missingok notifempty dateext} 단 root권한으로 할 것 ! copytruncate //무중단 상태에서도 실행 할 수 있는 옵션 daily //매일 로그 로테이팅을 한다. weekly montly도 있음 rotate 30 //로그파일이 30개 이상이면 지운다 missingok // 파일이 없어도 지나간다. nomissingok도 있음 noti.. 더보기