Archive for March, 2013

centos查看服务器信息常用的命令

Friday, March 22nd, 2013

一:使用CentOS常用命令查看cpu

more /proc/cpuinfo | grep “model name”
grep “model name” /proc/cpuinfo
[root@localhost /]# grep “CPU” /proc/cpuinfo
model name      : Intel(R) Pentium(R) Dual CPU E2180 @ 2.00GHz
model name      : Intel(R) Pentium(R) Dual CPU E2180 @ 2.00GHz
如果觉得需要看的更加舒服
grep “model name” /proc/cpuinfo | cut -f2 -d:

 

(more…)

如何找到php.ini的位置

Thursday, March 21st, 2013

[root@hk4 ~]# php -i | grep 'Configuration File'
Configuration File (php.ini) Path => /usr/local/etc/php5/cgi
Loaded Configuration File => /usr/local/etc/php5/cgi/php.ini

CSF Installation failed: LWP perl module (libwww-perl) missing

Wednesday, March 20th, 2013

While installaing CSF firewall on a plain Linux server, you may notice the “LWP perl module” missing error message:

# sh install.sh
 Configuring for OS
 Checking for perl modules failed
 You need to install the LWP perl module (libwww-perl) and then
 install csf

The problem mostly occurs on a plain Linux server where all perl modules are not installed during the OS installation. On servers with control panels, this issue won’t arise.

The fix is to install the libwww-perl module either with YUM OR from cpan prompt. (more…)

CentOS查看CPU信息、位数、多核信息

Wednesday, March 20th, 2013

# uname -a

Linux localhost.localdomain 2.6.18-164.el5PAE #1 SMP Thu Sep 3 04:10:44 EDT 2009 i686 i686 i386 GNU/Linux

(查看当前操作系统内核信息)

# lsb_release -a

LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: CentOS
Description: CentOS release 5.4 (Final)
Release: 5.4
Codename: Final
(more…)

centos 文件新建、删除、移动、复制等命令

Tuesday, March 5th, 2013

创建目录

mkdir 文件名

mkdir /var/www/test

cp复制命令

cp命令复制文件从一个位置到另一位置。如果目的地文件存在,将覆复写该文件; 如果目的地目录存在,文件将复制到该目录下 (目录不会被复写)。

(more…)

linux把文件压缩成.tar.gz的命令

Tuesday, March 5th, 2013

01-.tar格式
解包:[*******]$ tar xvf FileName.tar
打包:[*******]$ tar cvf FileName.tar DirName(注:tar是打包,不是压缩!)

02-.gz格式
解压1:[*******]$ gunzip FileName.gz
解压2:[*******]$ gzip -d FileName.gz
压 缩:[*******]$ gzip FileName

03-.tar.gz格式
解压:[*******]$ tar zxvf FileName.tar.gz
压缩:[*******]$ tar zcvf FileName.tar.gz DirName
(more…)