라벨이 linux인 게시물 표시

Linux cpu 정보확인

리눅스 CPU 개수 확인하기 리눅스 CPU 코어 수 확인하기 목차  [ 숨기기 ]  1 개요 2 CPU 코어 전체 개수 3 물리 CPU 수 4 CPU당 물리 코어 수 5 정리 6 같이 보기 7 주석 개요 CPU core 수를 셀 수 있다. 다만 인텔 하이퍼스레딩의 경우, OS(윈도우, 리눅스 등)에서 코어 수가 실제 코어 수의 2배로 인식된다. 예를 들어 싱글코어는 코어 2개로, 듀얼코어는 4개로 인식된다. CPU 코어 전체 개수 grep -c processor / proc / cpuinfo [ root @ jmnote ~]# grep -c processor /proc/cpuinfo 48 → 가상 CPU 코어 수는 48. 따라서 물리적으로는 24 코어. [1] 물리 CPU 수 명령어 grep "physical id" / proc / cpuinfo | sort -u | wc -l 실행예시 [ root @ jmnote ~]# grep "physical id" /proc/cpuinfo | sort -u | wc -l 4 CPU당 물리 코어 수 명령어 grep "cpu cores" / proc / cpuinfo | tail -1 예시 [ root @ jmnote ~]# grep "cpu cores" /proc/cpuinfo | tail -1 cpu cores : 6 → CPU당 물리 코어수가 6. 정리 위에서 확인한 사항들을 모아보면 다음과 같다. 물리 CPU 수: 4 물리 CPU당 물리 코어 수: 6 전체 물리코어수 : 24 [2] 전체 가상코어수 : 48 [3] 같이 보기 리눅스 CPU 속도 확인하기 윈도우 CPU 코어 수 확인 주석 ↑ 1 core(물리코어...

Linux 내 파일문서검색

Linux에서 파일 내에 특정 문자열을 검색해야 하는 경우가 종종 있다. - 현재 디렉토리 내 확장자가 txt인 파일들을 중에서 "홍길동"이라는 문자열을 갖고 있는 파일의 한 줄과 이름을 보여준다. find . -name "*.txt" | xargs grep 홍길동 - 이 때 검색어로 사용된 문자열은 색을 달리하여 표시하고 싶다면 find . -name "*.txt" | xargs grep --color=auto 홍길동  - 검색어의 위치(줄번호)를 같이 표기하고 싶다면 find . -name "*.txt" | xargs grep -n 홍길동 - 대소문자를 구분하고 싶지 않다면 find . -name "*.txt" | xargs grep -i LgMobile 즉, LGMobile, LGMOBILE, lgMobile을 가리지 않고 찾는다. - 현재 디렉토리 내 확장자가 txt인 파일들을 중에서 "홍길동"이라는 문자열을 갖고 있는 파일의 이름만 보고 싶다면 find . -name "*.txt" | xargs grep -l 홍길동 - 검색 결과에 다음과 같은 메시지가 포함된다면 grep: [특정경로]: No such file or directory 2>/dev/null 을 추가하면 해당 메시지를 표시하지 않고 찾은 결과만 볼 수 있다. 즉, find . | xargs grep 2>/dev/null 홍길동 - 모든 옵션은 함께 사용 가능하다. find . -name "*.txt" | xargs grep --color=auto -n 2>/dev/null 홍길동

좀비프로세스 죽이기

ps -ef | grep defunct | awk '{print $3}' | xargs kill -9

apache mpm 설정(펌)

1. 전제 조건 - apache 설치 시에 아래와 같이, 반드시   --with-mpm=worker  옵션을 설정 하고 설치한다.     이 옵션을 주지 않을 경우, Default인 Prefork방식으로 설치된다(Linux에 한함) ================================================================ ./configure --prefix=/home/paint/apache-2.2.15 --enable-mods-shared=all --enable-module=so --enable-so   --with-mpm=worker ================================================================ * 현재 worker 모듈 설치 되었는지 확인법 - "httpd -l" 명령으로 현재 설치된 Apache가 worker방식으로 설치되었는지 확인할 수 있다. ============================================ # httpd -l Compiled in modules:   core.c   worker.c   http_core.c   mod_so.c ============================================ 또는, httpd -V 명령으로 확인 가능하다. (V는 대문자) ============================================ # httpd -V Server version: Apache/2.2.15 (Unix) Server built:   Jun 30 2010 16:59:45 Server's Module Magic Number: 20051115:24 Server loaded:  APR 1.4.2, APR-Util 1.3.9 C...

Mysql 백업 및 복구

MySQL 백업 및 복구 - MySQL 디렉토리 전체를 압축 백업하기 mysql dir : /var/lib (데이터베이스 디렉토리) [root@byungun lib]# tar cvfpz mysql_dir_tar.gz /var/lib/mysql - 특정 데이터베이스 백업과 복구 백업 형식 : mysqldump -u DB계정명 -p DB명 > 저장할파일명 복구 형식 : mysql -u DB계정명 -p DB명 < 저장할파일명 # mysql DB 백업 [root@byungun DB_backup]# mysqldump -u root -p mysql > mysqldb.sql Enter password: # mysql DB 생성 [root@byungun DB_backup]# mysqladmin -u root -p create mysql Enter password: # mysql DB 복구 [root@byungun DB_backup]# mysql -u root -p mysql < mysqldb.sql Enter password: - 특정 데이터베이스의 특정 테이블 백업과 복구 백업 형식 : mysqldump -u DB계정명 -p DB명 Table명 > 저장할파일명 복구 형식 : mysql -u DB계정명 -p DB명 < 저장할파일명 # mysql DB Table 백업 [root@byungun DB_backup]# mysqldump -u root -p testdb testtable > testtable_table.sql Enter password: # mysql DB Table 복구 [root@byungun DB_backup]# mysql -u root -p testdb < testtable_table.sql Enter password: - 여러 개의 데이터베이스 한 번에 백업과 복구 백업 형식 : mysqldump -u DB계정명 -p --databases [옵션] DB...

apache tomcat 연동

RedHat Linux 기반의 Sulinux 1.5 ( http://www.sulinux.net/ ) Apache 2.2.4 ( http://www.apache.org/  - httpd) Mysql 5.0.37 ( http://www.mysql.com/ ) Tomcat 6.0.10 ( http://www.apache.org/  - tomcat ) JDK 6.0 ( http://java.sun.com/ ) Apache-Tomcat Connector (Jk Connector 1.2.21) ( http://www.apache.org/  - tomcat - connector) 모두  linux 용, Non-RPM 버전으로 받아서 설치하였음. 받은 모든 파일들은 /usr/local/ 로 ftp 전송등으로 복사. Mysql SHELL> tar xzvf mysql파일명.확장자 SHELL> ln -s /usr/local/mysql디렉토리명  mysql                       mysql디렉토리에 대한 링크를 만듬. (윈도우의 바로가기 같은 개념--;) SHELL> cd mysql SHELL> adduser -M mysql SHELL> chown -R root /usr/local/mysql SHELL> chown -R mysql /usr/local/mysql/data SHELL> ./configure 자동으로 실행까지 한다. SHELL> cp /usr/local/mysql/support-files/my-medium.cnf   /etc/my.cnf SHELL> ps             (mysqld_safe 가 있는지 확인.) SHELL> cd bin  (/usr/l...