본문 바로가기

develop

redis 명령어 한글 정리 사이트 http://redisgate.com/redis/command/commands.php 더보기
tomcat accesslog pattern 설정 (standard 설정) Common Log Format: %{X-Forwarded-For}i %l %u %t "%r" %s %b2Combined Log Format: %{X-Forwarded-For}i %l %u %t %r %s %b %{User-Agent}i %{Referer}i tomcat 의 server.xml 파일 안에 accesslog를 찍어내는 설정 중 pattern을 지정할 때 "common"이나 "combined"를 주면 스탠다드한 설정이 된다. common으로 했을 시 로그 포맷은 : %{X-Forwarded-For}i %l %u %t "%r" %s %b combined으로 했을 시 로그 포맷은 : %{X-Forwarded-For}i %l %u %t %r %s %b %{User-Agent}i %{Referer}i 더보기
권한 설명 750(drwxr-x---)640(-rw-r-----)752(drwxr-w-w-)642(-rw-r---w-) drwxr-x--- 기준 설명d : 디렉토리(있으면) 없으면 파일그 뒤로 세자리씩 끊어서 더한다. rwx : r=4 w=2 x=1고로 7r-x : r=4 w=비어있으므로 0 x=1고로 5 --- : r=0 w=0 x=0 고로 0 그러므로 750 drwxr-w-w-rwx : 7r-w : 5-w- : 4 고로 754 더보기
파일 수정된 시간 알아내기 1. 수정 및 생성된지 30일이 지난 파일들 찾기 - find -mtime +30 2. 어제 수정 및 생성된 파일 찾기 - find -mtime 1 3. 어제 이후로 수정 및 생성된 파일 찾기 - find -mtime -1 atime 접근 시간mtime 수정시간ctime 생성시간 파일관리#convmv#convmv - 파일명의 문자셋을 바꾼다.convmv -f cp949 -t utf-8 -r --notest . chmod + find #파일만find /home/vpopmail/domains/ -type f -exec chmod -v 644 {} \; 폴더만find /home/vpopmail/domains/ -type d -exec chmod -v 755 {} \; 해당파일만find /home/vpopmai.. 더보기
linux 프로세스 런타임 확인법 ps -o etime pid ex) ps -o etime 1727 4-07:12:15 4일 7시간 12분 15초동안 실행중. 더보기
redis key 패턴으로 삭제하기 터미널에서 아래와 같이 명령어를 입력한다. 만약 키값이 static_svc_idstatic_11,12,13,14_chkNumstatic_12,122,143,114_chkNumstatic_115,122,313,214_chkNumstatic_112,112,213,114_chkNumstatic_115,132,143,114_chkNumstatic_abcd_query 가 있을때 ./redis-cli KEYS static_*_chkNum | xargs ./redis-cli del 를 입력하면 남는 키는 static_svc_id / static_abcd_query가 된다. 더보기
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 옵션을 붙이면 가능하다 !! 더보기