netstat
·
Linux
netstat cmd는 현재 리눅스에서 사용중인 network 상태를 알려줌 netstat -anp : 현재 리눅스 서버와 연결된 모든 connection 정보 특정 데몬이 사용하는 네트워크 컨넥션 정보를 알고 싶을 때는 grep name 을 같이 사용하면 된다. netstat -anp | grep name 특정 데몬이 다수개의 connection을 가지고 있을 때 실행중인 데몬의 개수 netstat -anp | grep name | wc -l ESTABLISH 한 connection 확인 netstat -anp | grep EST
[Linux]cat , grep, awk, tail
·
Linux
cat i-d49dec9f.rhdrm.server.log | grep 'SEARCH STRING... :' | tail -n 10 cat i-d49dec9f.rhdrm.server.log | grep 'i-d49dec9f, TIME :\|ElapsedTime(sec)\|END TIME :' | tail -n 30 grep -E 'pattern1|pattern2' filename egrep 'pattern1|pattern2' filename grep -e pattern1 -e pattern2 filename egrep 'Manager|Developer' employee.txt | grep -v Sales ===> -v 제거 cat i-9affdbce.sedrm.server.lo* | grep 'STDERR..
find grep 파일명 찾기
·
Linux
find . -name "*.jsp" | xargs grep -n "smssend" jsp파일중에 smssend가 들어가 있는 파일 찾기 find / -name *kiwoom_customer.txt www]# find . -name '*.*' -type f -exec grep SAMPLE {} \; -print 또는 www]# find . -name '*.*' -type f | xargs grep SAMPLE
grep 명령어 사용법
·
Linux
1. 기능 파일 내에서 특정 패턴을 검색한다. 이름은 Global Regular Express Printer 의 머리글자이다. 2. 문법 # grep [ -vclhnief ] 표현 파일명(들) # fgrep [ -vclhnief ] 문자열 파일명(들) 3. 옵션-type pattern 형식이 pattern인 것. -V : 일치되는 내용이 없는 라인을 표시한다. -C : 일치되는 내용이 있는 행의 개수를 센다. -I : 일치되는 내용이 있는 파일의 이름만을 표시한다. -h : 일치되는 내용을 찾은 파일의 이름을 표시하지 않는다. -n : 일치 내용이 있는 행은 행 번호와 함께 표시된다. -i : 대소문자 구분을 하지 않는다. -e 표현 : 표현이 하이픈 문자로 시작될 때 사용한다. -f 파일 : 찾으려는 ..