OS + Linux RedHat / redhat7 / redhat 7 / redhat 6 / redhat 5

s

 

 

temp

http://jzhua.iteye.com/blog/609293

※ RHEL 7.0/7.1/7.2 没有x86版本,只有x86_64版本。

红帽 Red Hat Linux相关产品iso镜像下载【百度云】【更新7.2】

http://blog.csdn.net/yaer123/article/details/50470156

http://www.linuxfly.org/post/659/

RedHat Enterprise Server 6.8 for x86_64:

rhel-server-6.8-x86_64-dvd.iso

SHA-256 Checksum:

d35fd1af20f6adef9b11b46c2534ae8b6e18de7754889e2b51808b436dff2804

链接:百度云(密码:9dde)

RedHat Enterprise Server 6.8 for i386:

rhel-server-6.8-i386-dvd.iso 

SHA-256 Checksum: 

22d1754f3e642c2b60234c3f97d1d6689b33bef4dd2252e3f52cd9aa823bb5f3

链接:百度云(密码:vg3k)

RedHat Enterprise Server 6.8 for x86_64 Boot Disk:

rhel-server-6.8-x86_64-boot.iso

链接: 百度云(密码:  us92)

RedHat Enterprise Server 6.7 for i386 Boot Disk:

rhel-server-6.7-i386-boot.iso 

SHA-256 Checksum: 

798d24aa6a2805aebd46617c25bf769b97c47afac73c8674b5e32d4428c91130

链接:百度云( 密码:1aok)

RedHat Enterprise Server 6.7 for x86_64 Boot Disk:

rhel-server-6.7-x86_64-boot.iso

SHA-256 Checksum: 

7040ea6fea103edf24135ee85feaae9362985998d1a77133ee41de9bdac33465

链接:百度云( 密码:e92w)

RedHat Enterprise Server 6.7 for x86_64:

rhel-server-6.7-x86_64-dvd.iso

SHA-256 Checksum:

0e0acb2a544f4d58f10292144161f40439734c6e98b13ba8c595372b20354bc5

链接:百度云(密码:67lr)

RedHat Enterprise Server 6.7 for i386:

rhel-server-6.7-i386-dvd.iso 

SHA-256 Checksum: 

4f70a74d676c74609586d616648d7cd5720d48dcf789be10cc1da429d6734078

链接:百度云(密码:ykle)

RedHat Enterprise Server 5.8 for i386:百度云 密码:667b

RedHat Enterprise Server 5.8 for x86_64:百度云 密码:dddc

RedHat Enterprise Server 5.9 for i386:百度云 密码:2jgn

RedHat Enterprise Server 5.9 for x86_64:百度云 密码:ogxp

RedHat Enterprise Server 5.10 for i386:百度云 密码:lplv

RedHat Enterprise Server 5.10 for x86_64:百度云 密码:o5ff

RedHat Enterprise Server 6.2 for i386:百度云 密码:7ltl

RedHat Enterprise Server 6.2 for x86_64:百度云 密码:be66

RedHat Enterprise Server 6.3 for i386:百度云err 密码:3ctt

RedHat Enterprise Server 6.3 for x86_64:百度云 密码:rrzm

RedHat Enterprise Server 6.4 for i386:迅雷快传

RedHat Enterprise Server 6.4 for x86_64:迅雷快传

RedHat Enterprise Server 6.5 for i386:迅雷快传

RedHat Enterprise Server 6.5 for x86_64:迅雷快传

RedHat Enterprise Server 6.5 for x86_64 Boot Disk:迅雷下载

RedHat Enterprise Server 5.11 for i386:

rhel-server-5.11-i386-dvd.iso 

SHA-256 Checksum: 

4e38e4ed06d83efb10446e7db19d96761715cdbdbf0bbfacb978b44ce368bbe2

链接:百度云( 密码:5ssr)

RedHat Enterprise Server 5.11 for x86_64:

rhel-server-5.11-x86_64-dvd.iso 

SHA-256 Checksum: 

36565fe0c8a97207d63234d10123daeedb29d509576dbd7b34e71958ac2f9050

链接:百度云( 密码:mtkv)

RedHat Enterprise Server 6.6 for i386 Boot Disk:

rhel-server-6.6-i386-boot.iso 

SHA-256 Checksum: 

cd03cb68ee6be516006178c9ffca51f54e1c20e5579ad007b3c481f7b5efd816

链接:百度云( 密码:fmrq)

RedHat Enterprise Server 6.6 for i386:

rhel-server-6.6-i386-dvd.iso 

SHA-256 Checksum: 

0a14ed1f7d7ea7b831739ed8e71719d9cb7c294bf801e8db39358651768547ad

链接:百度云(密码:9csk)

RedHat Enterprise Server 6.6 for x86_64 Boot Disk:

rhel-server-6.6-x86_64-boot.iso

SHA-256 Checksum: 

4090213166ba64d067a8ce13ffe31e4bbfd60e60ff4c1c5ec5499ea26a0ebfeb

链接:百度云( 密码:2rbc)

RedHat Enterprise Server 6.6 for x86_64:

rhel-server-6.6-x86_64-dvd.iso

SHA-256 Checksum:

16044cb7264f4bc0150f5b6f3f66936ccf2d36e0a4152c00d9236fb7dcae5f32

链接:百度云(密码:1aah)

RedHat Enterprise Server 7.0 for x86_64 Boot Disk:

rhel-server-7.0-x86_64-boot.iso

SHA-256 Checksum:

b7a4f8b4d0132776ea20147abbb0a605d1a506ece92c704af5ab50796edc9a9b

百度云(密码:xtdw)

RedHat Enterprise Server 7.0 for x86_64:

rhel-server-7.0-x86_64-dvd.iso

SHA-256 Checksum:

85a9fedc2bf0fc825cc7817056aa00b3ea87d7e111e0cf8de77d3ba643f8646c

百度云(密码:62z7)

RHEL 7.0 Supplementary DVD

supp-server-7.0-rhel-7-x86_64-dvd.iso

SHA-256 Checksum:

75177a35b0c4e55086bdddc9e820d88a14ceef0b4e1ca0f2181df1c94020035f

百度云(密码:25x2)

RedHat Enterprise Server 7.1 for x86_64 Boot Disk:

rhel-server-7.1-x86_64-boot.iso

SHA-256 Checksum:

b6c57194130025cecc036676d43235508f4031d99041051ea1c61e259bd95903

百度云(密码:mhlf)

RedHat Enterprise Server 7.1 for x86_64:

rhel-server-7.1-x86_64-dvd.iso

SHA-256 Checksum:

3685468ec6cdcb70dfc85ebbc164da427dc2d762644c3c2ee1520f4f661c15ce

百度云(密码:tj3i)

RHEL 7.1 Supplementary DVD

supp-server-7.1-rhel-7-x86_64-dvd.iso

SHA-256 Checksum:

9fabc4808a3123bb0f6136fcea6a4817a25ba15016c6f45e704040c93240acb6

百度云(密码:y2ci)

RedHat Enterprise Server 7.2 for x86_64:

rhel-server-7.2-x86_64-dvd.iso

SHA-256 Checksum:

03f3a0291634335f6995534d829bd21ffaa0d000004dfeb1b2fb81052d64a4d5

百度云(密码:8anb)

rhel-server-7.2-x86_64-dvd.iso  下载

http://baiduyun.57fx.cn/detail-index-id-26323424.html

http://rhel.ieesee.net/uingei/rhel-server-7.2-x86_64-dvd.iso ?

http://rhel.ieesee.net/uingei/rhel-server-7.0-x86_64-dvd.iso

http://download.downcc.com/bigfile/3g/rhel-server-7.0-x86_64-dvd_downcc.com.iso

RHEL 6.4亲身体验五:展望RHEL 7

http://www.searchsv.com.cn/showcontent_72146.htm

RHEL 6.4体验
 RHEL 6.4亲身体验五:展望RHEL 7
 RHEL 6.4亲身体验四:配置Samba 4
 RHEL 6.4亲身体验三:搭建LNMP环境
 RHEL 6.4亲身体验二:安装后的基本操作
 RHEL 6.4亲身体验一:RHEL 6.4的新功能

http://en.wikipedia.org/wiki/Red_Hat_Enterprise_Linux#RHEL_6

RHEL 6[edit]

Red Hat Enterprise Linux 6 was forked from Fedora 12 and contains many backported features from Fedora 13 and 14.

Red Hat Enterprise Linux 6 (Santiago), 10 November 2010 Uses Linux kernel 2.6.32-71[17]

6.1, also termed Update 1, 19 May 2011 (kernel 2.6.32-131)[17]

6.2, also termed Update 2, 6 December 2011 (kernel 2.6.32-220)[17]

6.3, also termed Update 3, 20 June 2012 (kernel 2.6.32-279)[17]

6.4, also termed Update 4, 21 February 2013 (kernel 2.6.32-358)[17]

6.5, also termed Update 5, 21 November 2013 (kernel 2.6.32-431)[17]

RHEL 7[edit]

Red Hat Enterprise Linux 7 (Maipo) will be based on Fedora 19 and upstream Linux kernel 3.10, with the first beta announced on 11 December 2013.[19][11]

文档资源

redhat 5.4 download

http://www.dinyuan.cn/a/zaoanLinux/20091102/40.html

ftp://ftp.wallawalla.edu/pub/isos/ISOS/redhat/rhel/5.4/rhel-client-5.4-x86_64-dvd.iso

ftp://ftp.wallawalla.edu/pub/isos/ISOS/redhat/rhel/5.4/rhel-client-5.4-i386-dvd.iso

http://rhel.ieesee.net/uingei/rhel-server-5.4-x86_64-dvd.iso

http://rhel.ieesee.net/uingei/rhel-server-5.4-i386-dvd.iso   

http://59.36.100.206/server/rhel-server-5.4-i386-dvd.iso

redhat 5.5 download

ftp://ftp.wallawalla.edu

http://bbs.crackmv.cn/viewthread.php?tid=9423

[红帽企业Linux.5.5.for.x86_64.桌面版].[i.Studio]rhel-client-5.5-x86_64-dvd.iso

http://rocolex.blog.163.com/blog/static/68446410201042613150523/

http://mirrors.sohu.com/RHEL/AS5U5/x86_64/

ftp://ftp.wallawalla.edu/pub/isos/redhat/rhel/5.5/rhel-client-5.5-i386-dvd.iso

ftp://ftp.wallawalla.edu/pub/isos/redhat/rhel/5.5/rhel-client-5.5-x86_64-dvd.iso

http://mirrors.sohu.com/RHEL/AS5U5/i386/rhel-server-5.5-i386-dvd.iso

http://mirrors.sohu.com/RHEL/AS5U5/x86_64/rhel-server-5.5-x86_64-dvd.iso

redhat 5.6 download

ed2k://|file|[红帽企业.Linux.6].TLF-SOFT-Redhat.Enterprise.Linux.v6.UPDATE.1.X86_64.DVD-HOTiSO.iso|3600812032|d39b97540497d24175340915244e6da5|h=ni34qipkufzruqzid22lmiafg3sm6q3b|/
ed2k://|file|[红帽企业Linux.5.6].rhel-server-5.6-x86_64-dvd.iso|3794051072|f731570ce11f43ee593c92aadee8b48c|h=avggmtbdsdnduuadbxy7ggm3s4asysda|/

redhat 5.7 download

http://rhel.ieesee.net/uingei/rhel-server-5.7-i386-dvd.iso

http://rhel.ieesee.net/uingei/rhel-server-5.7-x86_64-dvd.iso

redhat 6.0 download

http://ftp.redhat.com/redhat/rhel/beta/6.0/i386/iso/

ftp://ftp.redhat.com/pub/redhat/rhel/beta/6/i386/iso/RHEL6.0-20100414.0-AP-i386-DVD1.iso

http://www.riscworks.net/CentOS/RHEL6_Beta/RHEL6.0-20100414.0-AP-i386-DVD1.iso

http://ftp.heanet.ie/pub/redhat/rhel/beta/6/i386/iso/RHEL6.0-20100414.0-AP-i386-DVD1.iso

ftp://ftp.redhat.com/pub/redhat/rhel/beta/6/x86_64/iso/RHEL6.0-20100414.0-AP-x86_64-DVD1.iso

http://www.riscworks.net/CentOS/RHEL6_Beta/RHEL6.0-20100414.0-AP-x86_64-DVD1.iso

http://ftp.heanet.ie/pub/redhat/rhel/beta/6/x86_64/iso/RHEL6.0-20100414.0-AP-x86_64-DVD1.iso

redhat 6.1 download

http://rhel.ieesee.net/uingei/rhel-server-6.1-i386-dvd.iso

http://rhel.ieesee.net/uingei/rhel-server-6.1-x86_64-dvd.iso

redhat 6.2 download

http://rhel.ieesee.net/uingei/rhel-server-6.2-i386-dvd.iso

http://rhel.ieesee.net/uingei/rhel-server-6.2-x86_64-dvd.iso

redhat 6.3 download

http://rhel.ieesee.net/uingei/rhel-server-6.3-i386-dvd.iso

http://rhel.ieesee.net/uingei/rhel-server-6.3-x86_64-dvd.iso

redhat 6.4 download

http://rhel.ieesee.net/uingei/rhel-server-6.4-i386-dvd.iso

http://rhel.ieesee.net/uingei/ rhel-server-6.4-x86_64-dvd.iso
redhat 6.4 download
http://bbs.itmop.com/thread-46316-1-1.html

U盘安装RHEL5.3的简单的方法

http://jingyan.baidu.com/article/359911f509bb1c57fe0306cf.html

U盘安装redhat6.3

http://wenku.baidu.com/view/eb4f8661011ca300a6c39082.html

    1.准备1个U盘 (最好 8G)

    2.下载UltraISO(主要用于将ISO镜像文件)

    3.下载 rhel-server-6.3-x86_64-boot.iso 这两个是用来引导系统安装盘的,也可以用rhel-server-6.3-x86_64-dvd.iso做引导

    4.用 UltraISO 打开 rhel-server-6.3-x86_64-boot.iso或者rhel-server-6.3-x86_64-dvd.iso ,

       点击 “启动” -- “写入硬盘映像...”,以USB-HDD+方式写入U盘,使U盘成为启动U盘。

    8.复制rhel-server-6.3-x86_64-dvd.iso到U盘根目录下。

    9.设置BIOS为U盘启动,即可顺利安装RHEL 6.3

 PS:    

     A.对于并不是6.0版本的镜像文件,在复制到U盘根目录后,需要把名称改为“rhel-server-6.0-i386-dvd.iso;

     B.对于使用rhel-6.1-i386-boot.iso及rhel-6.2-i386-boot.iso或以上rhel版本写入U盘的,

       把syslinux.cfg的第一行即“default vesamenu.c32”替换为

       “default linux timeout 600 label linux kernel vmlimuz append initrd=initrd.img”;

      (我因为没有改syslinux.cfg参数,导致多次引导失败)

RHEL64 缺少ISO 9660图像 安装程序试图挂载映像#1,在硬盘上无法找到该映像

http://blog.csdn.net/mao0514/article/details/42919987

用光盘安装Linux,很容易,按照提示一步一步就好。

如果没有光驱,只好想办法用硬盘或者U盘安装了。

首先说说怎样用U盘启动Linux的安装程序:

1.将ISO镜像文件拷贝到U盘中,并解压到U盘根目录。将isolinux目录中的vmlinuz、initrd.img拷贝到U盘根目录和C盘根目录。

2.使用Grub设置U盘引导启动Linux安装程序

可以下载EasyBCD,操作起来比较简单,不用去编写Grub命令。

3.重启系统

常见问题:

1.已经进入到Linux安装程序,但分区后,安装时提示“缺少ISO 9660图像 安装程序试图挂载映像#1,在硬盘上无法找到该映像”

这是因为系统在安装时无法找到ISO镜像文件,需要将镜像文件拷贝到U盘根目录(看来,光解压到U盘根目录还不够,最好还要将镜像文件也复制到U盘根目录) 

U盘安装RHEL6的简单的方法

http://breath.iteye.com/blog/1189070
1)UltraISO 
2)rhel-server-6.0-i386-boot.iso 
3)rhel-server-6.0-i386-dvd.iso 
4)容量大于或等于4G的U盘 
Step 1:用 UltraISO 打开 rhel-server-6.0-i386-boot.iso ,点击 “启动” -- “写入硬盘映像...”,使U盘成为启动U盘。 
Step 2:将 rhel-server-6.1-i386-dvd.iso 重命名为 rhel-server-6.0-i386-dvd.iso,并复制到 U盘中。 
Step 3:重启计算机,选择 U盘启动,即可正常安装。

Bash新手指南

http://xiaowang.net/bgb-cn/index.html

第 3 章 Bash环境

http://xiaowang.net/bgb-cn/ch03.html

RedHat5.1安装使用手册

http://hepg.sdu.edu.cn/Service/linux/document/redhat.html

http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/pdf/rhl-ig-x86-en-9.pdf

Red Hat Enterprise Linux 5安装图解

http://zhenglimeng1983.iteye.com/blog/230065

版本概念

http://hanxinyu.iteye.com/blog/95515
Red Hat Enterprise Linux 3 Update 3 ES (x86)
Red Hat Enterprise Linux 3 Update 4 AS (x86)

首先,他们都是redhat企业级Linux,简称为 RHEL。
AS=advanced server
ES=enterprise server

AS和ES,你可以看看这里: http://www.redhat.com/software/rhel/compare/

AS、ES功能上没有什么区别,只是在服务级别,支持的CPU数量和内存数量上有区别,比如ES只支持两颗CPU,最大16G内存。

Linux学习小结

http://bsb654321.iteye.com/blog/649050

系统安装

VMware Workstation 6.0 安装RHEL 5(图)

http://www.anqn.com/os/other/2009-03-31/a09108852.shtml

1  2  3  4  下一页

系统资源

RedHat RPM 包下载

http://www.solucorp.qc.ca/linuxconf/

ftp://ftp.solucorp.qc.ca/pub/linuxconf/devel/redhat-5.2

RedHat TAR 包下载

http://www.webmin.com/tgz.html

http://www.webmin.com/download.html

http://heimuad.iteye.com/blog/126856

http://blogger.org.cn/blog/more.asp?name=zhanglincon&id=35404

Red Hat Enterprise Linux AS 5 Server-i386 
下载地址:disc1   disc2   disc3   disc4   disc5 
安装序列号:2515dd4e215225dd 
Red Hat Enterprise Linux AS 5 Client-i386 
下载地址:disc1   disc2   disc3   disc4   disc5   disc6 
安装序列号:660266e267419c67

安装序列号:2515dd4e215225dd 
Red Hat Linux 9-i386 
下载地址:disc1   disc2   disc3

红帽子企业Linux 5安装序列号

http://linux.chinaunix.net/techdoc/desktop/2007/04/02/953977.shtml
  Server:
  * Red Hat Enterprise Linux (Server including virtualization):
    2515dd4e215225dd
    + Red Hat Enterprise Linux Virtualization Platform:
    49af89414d147589
  Client:
  * Red Hat Enterprise Linux Desktop:
    660266e267419c67
   + Red Hat Enterprise Linux Desktop + Workstation Option:
     da3122afdb7edd23
   + Red Hat Enterprise Linux Desktop + Workstation + DualOS Option
     (Virtualization):
     7fcc43557e9bbc42
   + Red Hat Enterprise Linux Desktop + DualOS Option (Virtualization):
     fed67649ff918c77

系统信息

redhat 系统时钟使用UTC

查看系统基本信息 , 各种系统下查看CPU与内存信息 .

http://devcool.cn/viewthread.php?tid=21&extra=page%3D1

[root@localhost /]# sh -version

GNU bash, version 3.2.25(1)-release (i686-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.

[root@localhost /]# uname -a 
Linux localhost.localdomain 2.6.18-92.el5xen #1 SMP Tue Apr 29 13:45:57 EDT 2008 i686

[root@localhost /]# lsb_release -a 
LSB Version:    :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 5.2 (Tikanga)
Release:        5.2
Codename:       Tikanga

查看系统主板信息

安装dmidecode软件

http://www.nongnu.org/dmidecode/

[root@ localhost dmidecode-2.4]#mv dmidecode-2.4.tar.gz /usr/local/ 
[root@ localhost dmidecode-2.4]#tar -xzvf dmidecode-2.4.tar.gz 
[root@ localhost dmidecode-2.4]# make install

install -m 755 dmidecode /usr/local/sbin
install -m 755 biosdecode /usr/local/sbin 
install -m 755 ownership /usr/local/sbin
install -m 755 vpddecode /usr/local/sbin
install -m 644 man/dmidecode.8 /usr/local/man/man8
install -m 644 man/biosdecode.8/usr/local/man/man8
install -m 644 man/ownership.8 /usr/local/man/man8
install -m 644 man/vpddecode.8 /usr/local/man/man8 就完成了。

[root@localhost /]# dmidecode | more

(略过more阅读,按q即可)

查看系统主板序列号   /  查看服务器序列号

[root@localhost /]# dmidecode |grep 'Serial Number'
[root@localhost /]# dmidecode | grep 'Serial Number' | awk '{print $3}' | tail -1

查看系统bios信息

[root@localhost /]# biosdecode | more

查看redhat 版本

[lindows@localhost ~]# lsb_release -a 

(注:这个命令适用于所有的linux,包括Redhat、SuSE、Debian等发行版。)

LSB Version:    :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 5.3 (Tikanga)
Release:        5.3
Codename:       Tikanga

http://rubyol.iteye.com/blog/146497

[lindows@localhost ~]$ cat /etc/redhat-release

[lindows@localhost ~]$ more /etc/redhat-release 
Red Hat Enterprise Linux Server release 5.2 (Tikanga)

[lindows@localhost ~]$  rpm -q redhat-release

redhat-release-5Server-5.3.0.3

[lindows@localhost ~]$ cat /etc/issue

[lindows@localhost ~]$ more /etc/issue 
Red Hat Enterprise Linux Server release 5.2 (Tikanga)

Kernel \r on an \m
查看redhat 内核版本

[lindows@localhost ~]$ cat /proc/version 
Linux version 2.6.18-92.el5xen (brewbuilder@hs20-bc2-3.build.redhat.com) (gcc version 4.1.2 20071124 (Red Hat 4.1.2-41)) #1 SMP Tue Apr 29 13:45:57 EDT 2008

[lindows@localhost ~]#  uname -a

Linux wcsdb2 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux

[lindows@localhost ~]#  uname -r

2.6.18-128.el5

查看redhat 系统位数    查看系统是64位还是32位

http://rubyol.iteye.com/blog/775780

1.直接看看有没有/lib64目目录的方法。64位的系统会有/lib64和/lib两个目录,32位只有/lib一个。

2.[root@localhost /]# getconf LONG_BIT

64

(32位的系统中int类型和long类型一般都是4字节,64位的系统中int类型还是4字节的,但是long已变成了8字节inux系统中可 用"getconf WORD_BIT"和"getconf LONG_BIT"获得word和long的位数。64位系统中应该分别得到32和64。)

3.

[root@localhost /]#  file /bin/ls

/bin/ls: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped

4.

[root@localhost /]#  lsb_release -a

LSB Version:    :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 5.3 (Tikanga)
Release:        5.3
Codename:       Tikanga

查看内存信息 swap 

[root@localhost /]#top

[root@localhost /]#free                                                                      --显示物理内存 KB显示

[root@localhost /]#free -m                                                                --显示物理内存 MB显示

[root@localhost /]#free -g                                                                 --显示物理内存 GB显示

[root@localhost /]#cat /proc/meminfo | more 

[root@localhost /]#more /proc/meminfo | more 

[root@localhost /]# grep MemTotal /proc/meminfo                                 --显示物理内存

[root@localhost /]# grep SwapTotal /proc/meminfo                               --显示交换空间

[root@localhost /]# df -h /dev/shm                                                         --查看共享内存

[root@localhost /]# df -h /tmp                                                                --查看/tmp大小 150~200M

[root@localhost /]# dmidecode |grep -A16 "Memory Device$"               --显示内存数量

查看CPU信息

[root@localhost /]# dmidecode -t 4

[root@localhost /]# cat /proc/cpuinfo 

[root@localhost /]# more /proc/cpuinfo

[root@localhost /]# more /proc/cpuinfo | grep model                     --显示CPU数量和频率

[root@localhost /]# grep "model name" /proc/cpuinfo                    --显示CPU数量和频率

[root@localhost /]# dmidecode |grep -A42 "Processor"|more         --显示cpu详细( -A42表示显示一下的行数 )

[root@localhost /]# cat /proc/cpuinfo | grep processor  | wc -l        --统计cpu数量

[root@localhost /]# more /proc/cpuinfo | grep processor   | sort -u --排序cpu数量

[root@localhost /]# more /proc/cpuinfo | grep "physical"  | sort -u  --排序cpu数量
[root@localhost /]# more /proc/cpuinfo | grep "physical"  | grep 0|wc -l    --单个cpu核心数量

[root@localhost /]# more /proc/cpuinfo | head -10                                  --cpu的info,类型和主频、cache等

查看硬盘信息 
[root@localhost /]# fdisk -l
[root@localhost /]# parted
[root@localhost /]# more /etc/scsi/scsi             --scsi接口的情况下

制作 光盘文件 ISO

http://codingstandards.iteye.com/blog/1249480

光盘是易损存储介质,如果需要长期保存,最好将其转储成iso镜像文件,在Linux下我们可以这样做:

方法1:cp /dev/cdrom name.iso

方法2:dd if=/dev/cdrom of=name.iso

其中name.iso自由设定,在执行上述命令之前

1. 要将光盘放入光驱中(废话!)

2. 不需要mount,如果mount了也没有关系

挂载光盘文件 ISO

http://lindows.iteye.com/blog/249765

http://jsx112.iteye.com/blog/946193

[root@linuxb db2]# mount -t iso9660 db2v8201.iso /mnt/cdrom -o loop

挂载光驱:mount -t iso9660 /dev/sda5 /mnt/linuxtool -o iocharset=utf8 
挂载普通盘:mount -t vfat /dev/sda5 /mnt/linuxtool -o iocharset=utf8 
这样挂载的ntfs格式的分区,只有root能读取,如果需要让普通用户也能读取,需要再加上umask=022 
挂载光驱:mount -t iso9660 /dev/sda5 /mnt/linuxtool -o iocharset=utf8,umask=022 
挂载普通盘:mount -t vfat /dev/sda5 /mnt/linuxtool -o iocharset=utf8,umask=022 
卸载: 
umount /dev/hda1 
有时候卸载分区时提示分区繁忙(device is busy),可以先用下面的命令看看哪个进程在使用此分区: 
fuser -cu /dev/hda1 
假如屏幕的输出为 
/dev/hda1: 8463m(cck) 
则可以用此命令看这个进程对应的程序名字: 
ps 8463 
然后可以用此命令结束此进程: 
kill -9 8463 这样就可以正常卸载分区了 
自动挂载:让Linux系统启动时自动挂载windows分区,可以把上述的命令写入 /etc/fstab 文件,如: 
/dev/hda9 / ext3 defaults 0 1 
/dev/hda13 none swap sw 0 0 
/dev/hdc /media/cdrom iso9660 ro,user,noauto 0 0 
/dev/fd0 /media/floppy auto rw,user,noauto 0 0 
/dev/hda10 /mnt/debian ext3 defaults 0 0 
/dev/hda1 /mnt/C ntfs utf8,umask=022 0 0 
/dev/hda5 /mnt/D vfat utf8,umask=0 0 0

查看服务列表

[root@localhost /]# chkconfig --list
[root@localhost /]# ntsysv --level 运行级别数
[root@localhost /]# setup

查询系统支持字符集 / 查询系统语言

[root@localhost /]# locale -a

修改系统当前字符集 / 修改系统语言

[root@localhost /]#   export  LANG=zh_CN.UTF-8

[root@localhost /]# vi   /etc/sysconfig/i18n

LANG= zh_CN.UTF-8

#add new LANG here

LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="lat0-sun16"

[root@localhost /]# cp /etc/sysconfig/i18n $HOME/.i18n

修改 $HOME/.i18n 文件,如

[root@localhost /]#vi $HOME/.i18n

添加内容:

LANG="en_US"   # xwindow会显示英文界面

LANG="zh_CN.GB18030"   # xwindow会显示中文界面

# 这样就可以改变个人的界面语言,而不影响别的用户。

显示系统支持字符集 / 显示系统语言

[root@localhost /]# echo $LANG

# RedHat 显示所有系统变量

[root@localhost /]#  export | less 

# Windows 显示所有系统变量

C:\Documents and Settings\Lindows>set  | more

# Windows 显示JAVA开头的变量

C:\Documents and Settings\Lindows>set  java

# RedHat 设置环境变量

bash shell 写法:export JAVA_HOME=/home/lindows/jdk1.6

tcsh shell 写法:setenv JAVA_HOME /home/lindows/jdk1.6

# RedHat 删除环境变量 / 清除环境变量

[root@localhost /]# unset  $变量名

一、注销,关机,重启

http://www.blogjava.net/loocky/archive/2007/07/17/130807.html

  注销系统的logout命令

  1,Logout 注销是登陆的相对操作,登陆系统后,若要离开系统,用户只要直接下达logout命令即可:

  [root@localhost root]#logout

  Red Hat Linuxrelease 9(Shike)

  Kernel 2.4.20.8 on an i686

  Login: ← 回到登陆的画面

  2,关机或重新启动的shutdown命令

  Shutdown命令可以关闭所有程序,依照用户的需要,重新启动或关机。

  参数说明如下:

   立即关机:-h 参数让系统立即关机。范例如下:

  [root@localhost root]#shutdown –h now ← 要求系统立即关机

   指定关机时间:time参数可指定关机的时间;或设置多久时间后运行shutdown命令,范例如下:

  [root@localhost root]#shutdown now ← 立刻关机

  [root@localhost root]#shutdown +5 ← 5分钟后关机

  [root@localhost root]#shutdown 10:30 ← 在10:30时关机

   关机后自动重启:-r 参数设置关机后重新启动。范例如下:

  [root@localhost root]#shutdown -r now ← 立刻关闭系统并重启

  [root@localhost root]#shutdown -r 23:59 ← 指定在23:59时重启动

  3,重新启动计算机的reboot命令

  顾名思义,reboot命令是用来重新启动系统的。常用的参数如下:

   -f 参数:不依正常的程序运行关机,直接关闭系统并重新启动计算机。

   -I 参数:在在重新启动之前关闭所有网络接口。

  虽然reboot命令有个参数可以使用,但是一般只需要单独运行reboot命令就可以了

华硕p5q-em不能进入centos 5.3的问题

http://hi.baidu.com/kson34/blog/item/7d5f6919d20c5276dab4bd54.html

启动RHEL5或CentOS时,出现以下错误提示:
ACPI: bus type pci registered
PCI: BIOS Bug: MCFG area at f0000000 is not E820-reserved <--
PCI: Not using MMCONFIG.
解决方法: 直接在内核后面加上:pci=nommconf
kernel /boot/vmlinuz-2.6.18-164.11.1.el5PAE ro root=LABEL=/1 rhgb quiet pci=nommconf

LINUX软件安装指南→tar.gz、rpm和bin格式!!!!!

http://www.linuxsir.org/bbs/showthread.php?t=217065

1、tar.gz安装,卸载 
最常用的安装方式就是1>解压tar zxvf file.tar.gz 2>进入刚解开的目录 运行./Configure 配置相关编译配置文件;3>make;make install,这就完成了此类软件的安装。当然,肯定不会所有此格式的软件包都要这样装,最可靠的还是看看目录中的readme或是install文 件, 里面一般都会说清楚软件的安装方法。 
有关它的删除可能就有些麻烦了, 有些软件在make install后, 会把执行文件或是库文件放到系统文件夹中,如果软件提供相应的uninstall命令就好, 如果不提供, 可能就得一个一个文件慢慢删了,不过也有相关SHELL命令组合可以记住它倒底放了哪些东西在哪里, 且应该可以用SHELL命令组合直接删掉那些文件,可怜我不会,还希望哪位大侠提供一下。当然, 也有不在系统文件中放东西的软件包, 那样就直接删掉那个被解开的文件夹应该就行了, 
2、rpm的安装,卸载

http://hi.baidu.com/cxyking/blog/item/de0dfe0f1c073ceaaa6457c2.html

rpm包卸载前检测该包的依赖关系

rpm -ev --test mysql-5.0.45-7.el5

rpm 卸载mysql错误

http://bugs.mysql.com/bug.php?id=37678

http://opensource.csdn.net/discuss/thread/128

http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html-single/Release_Notes/

[root@localhost /]# rpm -e mysql
error: Failed dependencies:
        libmysqlclient.so.15 is needed by (installed) dovecot-1.0.7-2.el5.i386
        libmysqlclient.so.15(libmysqlclient_15) is needed by (installed) dovecot-1.0.7-2.el5.i386

查看dovecot包依赖关系

rpm -ev --test dovecot-1.0.7-2.el5.i386

卸载dovecot包

yum -y remove dovecot-1.0.7-2.el5.i386

查看mysql和dovecot包依赖关系,并卸载mysql

rpm -e mysql

rpm包卸载 

rpm -e mysql-5.0.45-7.el5 # --nodep忽略依赖性安装 --replace重新安装

rpm包安装

rpm -ivh file.rpm  #参数i 安装, v 校验,h 进度条

rpm包升级

rpm -Uvh file.rpm #参数U是升级安装,也可以用它进行安装

yum命令安装和卸载RPM包

http://hukunlin.blog.51cto.com/545402/144071

#yum install dovecot //安装dovecot(邮件pop3协议)包
#yum remove dovecot //删除dovecot包
#yum clean all //清除yum缓存
#yum list //列出所有可安装的软件包
#yum list updates //列出所有可更新的软件包

3、bin安装,卸载 
bin包是编译好的二进制可执行文件,在用chmod 755可执行权限之后, 可以直接运行 
./file.bin就能安装, 至于卸载,我还不是很清楚, 好象也是删除它所产生的目录就行了 。

3、bundle安装,卸载

bundle包是编译好的二进制可执行文件,在用chmod 755可执行权限之后, 可以直接运行 
./file.bundle就能安装, 至于卸载,我还不是很清楚, 好象也是删除它所产生的目录就行了 。

Yum Server - configure on RHEL 5

http://linux.ittoolbox.com/groups/technical-functional/linuxadmin-l/yum-server-configure-on-rhel-5-4039273

Update RHEL5 using YUM package via CentOS online sources

http://it.megocollector.com/?p=1313

RHEL5  YUM的使用

http://blog.csdn.net/gausing/article/details/3706109

Linux-yum安装整个过程讲解(图)

http://www.bycnboy.com/article.asp?id=1087

RHEL5.X配置本地yum (图文示例)

http://blog.163.com/longsu2010@yeah/blog/static/173612348201161112730235/

配置Redhat Enterprise Linux 5.3使用CentOS的更新源

http://www.iteye.com/topic/690481

另外,如果服务器需要通过代理上网,则需要设置一下代理服务器才能进行联网更新:

在 /etc/yum.conf文件加入下面一行内容,指定一下代理服务器参数:

[root@localhost lindows]# Set http proxy
proxy=http://192.168.1.100:8000

RedHat 配置代理上网方法(fuck)

[root@localhost lindows]# export http_proxy=上网账号:Sn%4012345@192.168.1.1:8080
[root@localhost lindows]# export https_proxy=上网账号:Sn%4012345@192.168.1.1:8080

[root@localhost lindows]# export http_proxy=http://上网账号:Sn%4012345@192.168.1.1:8080
[root@localhost lindows]# export https_proxy=https://上网账号:Sn%4012345@192.168.1.1:8080

MacOS X 配置代理上网方法 (fuck)

http://stackoverflow.com/questions/197904/how-do-i-use-cygwin-behind-the-corporate-firewall

方法一,终端输入,临时变量写法

export http_proxy=http://yourusername:yourpassword@host:port/

export https_proxy=$http_proxy

方法儿,编辑文件,局部变量写法,编写文件 vim ~/.bash_profile

proxy=http://host.com:port/

export http_proxy=$proxy

export HTTP_PROXY=$proxy

使文件生效,终端输入source ~/.bash_profile

 

RHEL5.X配置本地yum

"C:\Program Files\NetSarang\Xmanager Enterprise 3\Xbrowser.exe"

-- 192.168.100.149

-- Application -- Add/Remove Software -- Pakage Manager -- Edit -- Respositories Manager -- add

-- Add New  Redpository

[root@b2cbbstest yum.repos.d]# more /etc/yum.repos.d/lindowsname.repo

[lindowsname]
enabled = 1
name = lindowsdesc
baseurl = http://192.168.134.16/pub/rhel5/Server/
gpgcheck = 0

[root@b2cbbstest soft]# yum clean all 
Loaded plugins: rhnplugin, security
Repository base is listed more than once in the configuration
Existing lock /var/run/yum.pid: another copy is running as pid 4822.
Another app is currently holding the yum lock; waiting for it to exit...

[root@b2cbbstest soft]# yum clean all 
Loaded plugins: rhnplugin, security
Repository base is listed more than once in the configuration
Cleaning up Everything

RHEL6设置本地YUM源

http://jingyan.baidu.com/article/1e5468f90fd265484961b7bf.html

工具/原料

装有RHEL6系统的电脑

RHEL6安装ISO镜像文件

1、挂载iso镜像,拷贝文件

1

命令如下:

mount -o loop /mnt/hgfs/shared/rhel-server-6.0-i386-dvd.iso  /mnt

mkdir /media/rhel_local_resource

cp –a  /mnt/*  /media/rhel_local_resource

2

其中的拷贝操作可能会需要花费些时间,因为安装iso文件很大的缘故,如下图所示 :

RHEL6设置本地YUM源

END

2、创建repo文件

1

在 /etc/yum.repos.d/中删除原来repo文件,新建一个扩展名为.repo的文件,文件名自定义。

命令如下:

vim  /etc/yum.repos.d/mylocal.repo

2

文件内容如下:

RHEL6设置本地YUM源

3

文件内容含义解释:

[]: 

     中括号中的是repository id,id可以随意命名,不过要注意的是不能存在

     相同的id,因为id是用来标识不同容器的;

name:

     后接repository name,用来说明容器,随意命名;

baseurl:

     repository的地址,如果是网络地址,就用http://,如果本地地址,就用

     file://。我们这里用的就是本地地址。注意上面的之所以是三个“///”,

     是因为第三个“/”表示根目录。

enable:

     表示这个容器是否启用。启用就设置为1,不启用就设置为0。

gpgcheck:

      表示是否检查rpm文件的数字签名。检查就设置为1,不检查就设置为0。

gpgkey:

      就是数字签名的公钥文件所在位置。如果gpgcheck值为1,此处就需要指

      定gpgkey文件的位置,如果gpgcheck值为0 ,就不需要此项了。上面的

      gpgcheck设置为0,此处可以没有gpgkey。

END

3、修改yumRepo.py 文件

1

命令如下:

vim  /usr/lib/python2.6/site-packages/yum/yumRepo.py

2

找到如下行

remote = url + '/' + relative

修改为

remote = "/media/rhel_local_resources" + '/' + relative

如下图所示:

RHEL6设置本地YUM源

3

至此,配置就完成了。接下来测试一下配置是否成功。

END

4、清理过期YUM缓存

1

命令如下:

yum clean all

如下图所示:

RHEL6设置本地YUM源

END

5、测试配置

1

命令如下:

yum grouplist

2

成功返回组列表,表示配置成功,如下图所示:

RHEL6设置本地YUM源

3

赶快去尝试yum安装带来的乐趣吧!

RedHat 5.5 x86_64 配置samba服务

http://www.cnblogs.com/xmphoenix/archive/2012/04/12/2443991.html

0、环境检查

[root@Loadrunner19 Server]# cat /etc/issue

Red Hat Enterprise Linux Server release 5.5 (Tikanga)

Kernel \r on an \m

[root@Loadrunner19 Server]# getconf LONG_BIT

64

1、检查安装包、准备安装包

#rpm –qa | grep samba

必须有以下安装结果

samba-3.0.25b-0.el5.4

samba-common-3.0.25b-0.el5.4

samba-client-3.0.25b-0.el5.4

samba-swat-3.0.25b-0.el5.4

如果没有的话得需要安装对应的安装包

samba-3.0.33-3.28.el5.x86_64.rpm

samba-swat-3.0.33-3.28.el5.x86_64.rpm

samba-common-3.0.33-3.28.el5.x86_64.rpm

samba-client-3.0.33-3.28.el5.x86_64.rpm

[root@Loadrunner19 Server]# rpm -ivh samba-3.0.33-3.28.el5.x86_64.rpm

warning: samba-3.0.33-3.28.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

error: Failed dependencies:

perl(Convert::ASN1) is needed by samba-3.0.33-3.28.el5.x86_64

一般会出现以安装依赖包问题,先安装关联包即可:http://blog.sina.com.cn/s/blog_5773f1390100w2w3.html

[root@Loadrunner19 Server]# rpm -ivh perl-Convert-ASN1-0.20-1.1.noarch.rpm

warning: perl-Convert-ASN1-0.20-1.1.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing...                ########################################### [100%]

   1:perl-Convert-ASN1      ########################################### [100%]

[root@Loadrunner19 Server]# rpm -ivh samba-3.0.33-3.28.el5.x86_64.rpm 

warning: samba-3.0.33-3.28.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing...                ########################################### [100%]

   1:samba                  ########################################### [100%]

[root@Loadrunner19 Server]# rpm -ivh samba-swat-3.0.33-3.28.el5.x86_64.rpm 

warning: samba-swat-3.0.33-3.28.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing...                ########################################### [100%]

   1:samba-swat             ########################################### [100%]

[root@Loadrunner19 Server]# rpm -qa | grep samba

samba-3.0.33-3.28.el5

samba-swat-3.0.33-3.28.el5

samba-common-3.0.33-3.28.el5

samba-client-3.0.33-3.28.el5

2、配置samba服务通过修改配置文件

RedHat 5.5 x86_64 配置samba服务 / SWAT—Samba WEB管理工具

http://www.linuxidc.com/Linux/2013-09/90758.htm 

① 将“only_from=127.0.0.1”改成“only_from=0.0.0.0”,这样该服务器就可以监听所有的来访IP。

② 将“disable=yes”改成“disable=no”,这样swat子进程就可以随xinetd超级守护进程一起启动了。可以吃用chkconfig命令查看swat是否启用了。

③ swat默认使用tcp的901端口。“port=901”,可以修改。

④ 通过web来配置samba,默认使用root账号进入。“user=root”,可以修改成其他的系统用户。

⑤ swat的执行程序默认在/usr/sbin目录下。

[root@Loadrunner19 ~]# /usr/sbin/swat --help

Usage: swat [OPTION...]

  -a, --disable-authentication       Disable authentication (demo mode)

  -P, --password-menu-only           Show only change password menu

Help options:

  -?, --help                         Show this help message

  --usage                            Display brief usage message

Common samba options:

  -d, --debuglevel=DEBUGLEVEL        Set debug level

  -s, --configfile=CONFIGFILE        Use alternate configuration file

  -l, --log-basename=LOGFILEBASE     Base name for log files

  -V, --version                      Print version

[root@Loadrunner19 ~]# /usr/sbin/swat -V

Version 3.0.33-3.28.el5

[root@Loadrunner19 ~]# vim /etc/xinetd.d/swat

  1 # default: off
  2 # description: SWAT is the Samba Web Admin Tool. Use swat \
  3 #              to configure your Samba server. To use SWAT, \
  4 #              connect to port 901 with your favorite web browser.
  5 service swat
  6 {
  7         port            = 901
  8         socket_type     = stream
  9         wait            = no
 10         only_from       = 0.0.0.0    #原127.0.0.1修改为0.0.0.0使所有来访IP可访问
 11         user            = root
 12         server          = /usr/sbin/swat
 13         log_on_failure  += USERID
 14         disable         = no
 15 }
重启samba swat 服务如下:

[root@Loadrunner19 ~]# service xinetd restart

Stopping xinetd:                                           [  OK  ]

Starting xinetd:                                           [  OK  ]

VirtualBox下RedHat 5.4 使用DVD光盘作为yum源 / vmware下配置CDROM的yum源 , 镜像文件:rhel-server-5.5-x86_64-dvd.iso

http://blog.csdn.net/biplusplus/article/details/7080749

1.挂载rhel-server-5.5-x86_64-dvd.iso   

[root@localhost media]# df -h

文件系统              容量  已用 可用 已用% 挂载点

/dev/mapper/VolGroup00-LogVol00

                       16G  4.3G   11G  30% /

/dev/sda1              99M   14M   81M  15% /boot

tmpfs                 1.8G     0  1.8G   0% /dev/shm

none                  1.8G  104K  1.8G   1% /var/lib/xenstored

/dev/hdc              3.5G  3.5G     0 100

2.配置cdrom的yum源

[root@localhost Server]# cat > /etc/yum.repos.d/cdrom.repo<<EOF

> [cdrom]

> name=cdrom Server

> baseurl=file:///media/RHEL_5.5\ x86_64\ DVD/Server

> enable = 1

> gpgcheck = 0

> EOF

[root@localhost Server]# yum clean all

Loaded plugins: rhnplugin, security

Options Error: Error parsing 'file:///media/RHEL_5.5\\ x86_64\\ DVD/Server': URL must be http, ftp, file or https not ""

注:由于文件路径中有空格,所以需要将其转义成%20

[root@localhost Server]# cat > /etc/yum.repos.d/cdrom.repo<<EOF

> [cdrom]

> name=cdrom Server

> baseurl=file:///media/RHEL_5.5%20x86_64%20DVD/Server

> enable = 1

> gpgcheck = 0

> EOF

[root@localhost yum.repos.d]# yum clean all

Loaded plugins: rhnplugin, security

Cleaning up Everything

1.4总结:YUM常用命令:
1.yum 安装软件包:
yum install package
yum localinstall package 从本机目录安装软件包
yum groupinstall group 安装某个组件的全部软件包
2.yum 更新软件包:
yum update package
yum check-update 列出所有可更新的软件包
yum list updates mysql* 查找mysql的更新
yum update 更新所有可更新的软件包
yum update mysql* 更新所有mysql的软件包
yum groupupdate group 更新某个组件的所有软件包
yum list 列出所有已安装和仓库中可用的软件包
yum list available 列出仓库中所有可用的软件包
yum list updates 列出仓库中比当前系统更新的软件包
yum list installed 列出已安装的软件包
yum list recent 列出新加入仓库的软件包
yum info 查询软件包信息
3.yum 删除软件包:
yum remove package
yum groupremove group 删除某个组件的全部软件包
4.yum 清除软件包
yum clean packages 清除遗留在缓存里的包文件
yum clean metadata 清除遗留在缓存里的元数据
yum clean headers 清除遗留在缓存里的头文件
yum clean all 清除包文件,元数据,头文件
5.搜索软件包:
yum search package
yum info package 查找一个软件包的信息
yum list package 列出包含指定信息的软件包
yum list installed 列出已安装的软件包
yum list extras 列出不是通过软件仓库安装的软件包
yum list *ttp* 列出标题包含ttp的软件包
yum list updates 列出可以更新的软件包
6.查找特定文件是由什么软件包提供的:
yum whatprovides filename
例子:
yum whatprovides httpd.conf
可用选项
–disalberepo=lib 禁用某个软件仓库
–enalberepo=lib 启用某个软件仓库
-C 禁用使用本机缓存的元数据
例子:
yum –disalberepo=livna|–enalberepo=livna install mplayer
yum -C info httpd

查看Windows所有用户列表

C:\Documents and Settings\Lindows>net user

查看redhat所有用户列表

[lindows@localhost ~]$ cat /etc/passwd

--这种su不带参数方式进入root用户时输入某些命令不可用。

[lindows@localhost ~]$ su
口令:
[root@localhost lindows]# ifconfig
bash: ifconfig: command not found

[lindows@localhost ~]$ su

[lindows@localhost ~]$ su - 

[lindows@localhost ~]$ su - root

#注:查看用户的UID和GID信息 ,主要是看是否切换过来了

[root@localhost ~]# id 
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) context=root:system_r:unconfined_t

http://renren4.iteye.com/blog/277916

RedHat 网络管理 RedHat Enterprise 基本网络配置

http://www.5dlinux.com/article/7/2009/linux_35279.html

http://xiejianying.blog.51cto.com/837040/262341

Redhat Linux 修改主机名(HOSTNAME)

http://www.hackbase.com/tech/2011-09-15/65257.html
       看机器名:uname -a
  修改机器名:
  redhat中修改主机名
  第一步:#hostname oratest
  第二步:修改/etc/sysconfig/network中的hostname
  第三步:修改/etc/hosts文件
  suse linux:
  修改/etc/HOSTNAME文件,在此文件中保存主机名,例如:homer100
  然后运行命令设置主机名# /etc/rc.d/boot.localnet start

Redhat 7.2 x64修改主机名称hostname

[root@B2Cmonitor sysconfig]# hostnamectl set-hostname "YOURHOSTNAME"

#通过配置文件修改主机名
[root@B2Cmonitor sysconfig]# vi /etc/sysconfig/network    
NETWORKING=yes
HOSTNAME=NEWHOSTNAME        

#通过配置文件修改主机名

[root@B2Cmonitor sysconfig]# vi /etc/hosts

1.修改运行时Linux系统的hostname ,即不需要重启系统

2.永久更改Linux的hostname

3.hostname 与/etc/hosts的关系

4.hostname 带选项查询

hosts文件格式是一行一条记录,分别是IP地址 hostname aliases,三者用空白字符分隔,aliases可选.

http://bbs.chinaunix.net/viewthread.php?tid=16141

修改HOSTNAME一行为"HOSTNAME=主机名"(没有这行?那就添加这一行吧)

[root@B2Cmonitor sysconfig]# vim /etc/sysconfig/network

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=B2Cmonitor
GATEWAY=192.168.100.254

[root@B2Cmonitor sysconfig]#hostname B2Cmonitor

一般还要修改/etc/hosts文件 中的主机名。这样,无论你是否重启,主机名都修改成功。

[root@B2Cmonitor sysconfig]# more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               B2Cmonitor localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6
192.168.100.149  b2cmonitor  b2cmonitor.cns*****.com

-- RedHat 查看网卡 //显示指定接口的信息

[root@localhost ~]#ifconfig eth0

-- RedHat 查看网卡 //显示指定接口的信息(无论是否活跃)

[root@localhost ~]#ifconfig -a

-- RedHat 查看网卡是否有网线物理连接

[root@localhost ~]#/sbin/mii-tool

eth0: negotiated 100baseTx-FD flow-control, link ok

-- RedHat 禁用网卡

[root@localhost ~]#ifconfig eth0 down

-- RedHat 启用网卡

[root@localhost ~]#ifconfig eth0 up

-- RedHat 重启 网卡

[root@localhost ~]# service network restart

-- 查看网卡路由和网关

http://jythoner.iteye.com/blog/312588

[root@teps ~]# route -n

[lindows@localhost ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0

[root@lindows112 ~]# /sbin/route

[root@lindows112 ~]# /sbin/route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.17.25.235   172.17.25.254   255.255.255.255 UGH   0      0        0 eth0
172.17.25.0     *               255.255.255.0   U     0      0        0 eth0
169.254.0.0     *               255.255.0.0     U     0      0        0 eth0
default         172.17.25.253   0.0.0.0         UG    0      0        0 eth0
-- 临时添加默认网关
[root@lindows112 ~]# route add default gw 172.17.25.253
-- 临时删除默认网关
[root@lindows112 ~]# route del default gw 172.17.25.253
-- 临时添加静态路由
[root@lindows112 ~]# route del default gw 172.17.25.253
-- 添加静态路由表
[root@lindows112 ~]# route add -net 192.168.1.0/24 gw 172.17.25.254

http://sobar.soso.com/tie/18672432.html
[root@lindows112 network-scripts]# ./route-eth0 GATEWAY0=10.10.0.1 NETMASK0=255.0.0.0 ADDRESS0=10.0.0.0 GATEWAY1=10.2.0.1 NETMASK1=255.255.0.0 ADDRESS1=192.168.0.0
-- 查看静态路由表
[root@lindows112 ~]# cat /etc/sysconfig/network-scripts/route-eth0

一、$/sbin/ifconfig //显示ifconfig命令查看网络接口的信息
#ifconfig eth0 //显示指定接口的信息
#ifconfig -a //显示所有接口的信息(无论是否活跃)
#ifconfig eth0 192.168.0.2 netmask 255.255.255.0
//临时修改接口IP地址(无需重启接口)
二、$/sbin/route //显示当前Linux主机中的路由表信息
1、#route del default gw 192.168.0.1
//临时删除默认网关192.168.0.1
2、#route add default gw 192.168.0.1
//临时添加默认网关192.168.0.1
3、#route add -net 192.168.1.0/24 gw 192.168.0.254
//临时添加一条静态路由
/**本文中提及临时操作的地方,即主机重启后该操作将失效,如果希望每次系统重启后自动添加静态路由条目,则可以将该语句写入/etc/rc.d/rc.local中。**/
三、#ping //测试与其他主机的网络连接
1、#ping -c 4 192.168.0.1 //指定发出ICMP包个数
循环ping,Linux下ping加上时间戳,24小时,86400秒不停ping方法如下:
[root@Loadrunner19 ~]# nohup ping 10.24.41.207 -c 86400 | awk '{ print $0"\t" strftime("%H:%M:%S",systime()) } ' > ping.log & 
四、#traceroute //测试当前主机到目的著急的网络连接
五、#hostname //查看当前主机的主机名
1、#hostname linsrv //临时修改当前主机名
六、#nslookup //测试DNS域名解析
>server //显示当前DNS服务器
>server 192.168.0.1 //临时指定DNS服务器地址
七、#dhclient //为当前主机申请网络配置信息
八、#netconfig //通过向导在字符界面下修改网络配置信息
九、#/etc/init.d/network restart //重启网络服务
1、#/etc/init.d/network stop //停止网络服务
2、#/etc/init.d/network start //启动网络服务
/**无论是通过netconfig,还是通过修改配置文件的方式修改了网络配置信息,都需要重启network服务才能生效**/
十、#service network start //启动网络服务
1、#service network stop //停止网络服务
2、#service network restart //重启网络服务
3、#service network status //查看网络服务状态
/**在RHEL4中可以通过service命令来管理大多数服务的启动、停止、重启以及查看其工作状态等**/
十一、#chkconfig --list | grep network //查看某服务的自动启动级别
1、#chkconfig --level 35 network off //设置在级别35不自动启动某服务
2、#chkconfig --level 3 network on //设置在级别3自动启动某服务
十二、ntsysv //通过向导在字符界面下修改服务的自启动选项
十三、#vi /etc/sysconfig/network-scripts/eth0 //编辑指定网络接口配置文件
DEVICE=eth0 //指定接口名称
ONBOOT=yes //系统启动时加载
BOOTPROTO=static //IP地址静态配置,若该值为“dhcp”则为动态获得
IPADDR=192.168.0.1 //设置IP地址
NETMASK=255.255.255.0 //设置子网掩码
GATEWAY=192.168.0.254 //设置默认网关
/**注意:设置之后必须要重启network服务或者重启接口(#ifdown eth0;ifup eth0),才能生效。**/
十四、#vi /etc/sysconfig/network //通过配置文件修改主机名
NETWORKING=yes
HOSTNAME =localhost.localdomain //修改该值作为主机名,如:rhel.lpwr.net
//该配置修改后,要重启系统方能生效
十五、#vi /etc/hosts //设置本地DNS解析文件
127.0.0.1 localhost.localdomain localhost //该行强烈建议保留
192.168.0.1 rhel.lpwr.net rhel //必须有三个字段:IP、FQDN、HOSTNAME
十六、#vi /etc/resolv.conf //指定当前主机的DNS服务器,最多可指定三个
search lpwr.net //设置当前主机的默认查找域
nameserver 192.168.0.100 //指定首选DNS服务器
nameserver 172.16.254.2
nameserver 202.106.0.20

RedHat 时区管理

查看/修改Linux时区和时间

http://pterodactyl.iteye.com/blog/399012

date 显示或设置系统时间与日期 

# 修改linux日期

2. [root@localhost ~]# date -s 03/04/2010

# 修改linux时间

4. [root@localhost ~]# date -s 21:55:00

RedHat 用户管理

--  使用scp远程拷贝文件/文件夹 
    注意:使用这个命令的前提条件是需要开通ssh服务。 
    拷贝文件: 
    scp 文件或文件夹 需要拷贝至目标机器IP:需要保持目录 
    scp 本地用户名 @IP 地址 : 文件名 1 远程用户名 @IP 地址 : 文件名 2 
    scp -r root@10.128.100.117:/root/tapserver_c02/ODP.zip ./ 
    例题:scp /iso/install.tar 10.128.100.116:/home/ 
    拷贝文件夹: 
    scp -r db/ 10.128.100.117:/temptest/

配置scp在Linux或Unix之间传输文件无需密码

http://www.linuxidc.com/Linux/2015-01/111894.htm

如何配置scp文件传输

实现scp在Linux或Unix之间传输文件,首先需要配置好scp,默认scp要使用密码的,通过以下配置可以不用输入密码,就完成Linux或Unix之间的文件传输

假设有2台Linux, A server, B server(ip假设为xxxx8),需要将文件(包括目录)从A传输到B,BFagent安装在A上面。 A上面的linuxidc用户,B上面也是linuxidc用户

A 机器上

A server上

第一步, 进入/home/linuxidc  cd /home/linuxidc  (因为我们使用的是linuxidc用户,如果使用了其他用户,就需要进去其他用户的目录, 比如 cd /home/weblogic)

第二部, 创建.ssh目录, mkdir .ssh

第三部, 进入.ssh目录,cd .ssh

第四部, 执行 ssh-keygen -b 1024 -t rsa

B server上

第一步, 进入/home/linuxidc  cd /home/linuxidc  (因为我们使用的是linuxidc用户,如果使用了其他用户,就需要进去其他用户的目录, 比如 cd /home/weblogic)

第二部, 创建.ssh目录, mkdir .ssh

第三部, 进入.ssh目录,cd .ssh

第四部, 创建新文件authorized_keys,  touch authorized_keys

A server上

第五步, 执行scp -p .ssh/id_rsa.pub linuxidc@xxxx.238:/home/linuxidc/.ssh/authorized_keys/authorized_keys

        将生成的id_rsa.pub放到B server上的授权key文件中。  

第六部, 测试文件传输,可以将/home/linuxidc 下面的某个目录传输给B。

        例如将/home/linuxidc下面的dir001(该目录包括多个文件和目录) 传输到B server上/home/linuxidc/testdir目录下面

        scp -r dir001 linuxidc@9.xxxx:/home/linuxidc/testdir

B server上

第五步, 进入/home/linuxidc/testdir, 检查传输的文件

用户设置Linux SSH登录前后的欢迎信息

http://www.blogjava.net/baizhihui19870626/articles/372694.html

Linux可以设置登录前后的欢迎信息,虽然没什么实际用处,纯粹为了好玩,体现一下自己系统的一点个性!
在登录系统输入用户名之前,可以看到上方有WELCOME......之类的信息,这里会显示LINUX发行版本名称,内核版本号,日期,机器信息等等信息,要设置的话,首先打开/etc/issue文件,可以看到里面是这样一段"Welcome to <LINUX 发行版本名称>-kernel 后接各项参数\"
后接的参数的各项说明:
\r 显示KERNEL内核版本号;
\l 显示虚拟控制台号;
\d 显示当前日期;
\n 显示主机名;
\m 显示机器类型,即CPU架构,如i386等;
了解了参数的意义,就来修改,将上面一段欢迎信息修改如下,可以显示所有必要的信息:
Welcome to <LINUX 发行版本名称>-kernel \r (\l) \d \n \m.
要看效果,EXIT退出登录后看看!
还有/etc/motd这个文件,可以在里面加入自己喜欢的任何欢迎信息,这段信息将会在登录成功后显示!

Connecting to 10.19.95.19:22...

Connection established.

To escape to local shell, press 'Ctrl+Alt+]

Last login: Fri Mar 21 15:50:26 2014 from 10.19.115.178

--------------------------------

|欢迎登录性能测试组专用五星神机|

|          ★★★★★          |

--------------------------------

# find / -type f -print | xargs grep "device"//用grep命令在所有的普通文件中搜索device这个词

http://lindows.iteye.com/admin/blogs/1834884

[root@Loadrunner19 ~]# find /etc -type f -print | xargs  grep "五星"

/etc/motd:|欢迎登录性能测试组专用五星神机|

linux 批量替换文件内容及查找某目录下所有包含某字符串的文件(批量修改文件内容)

http://blog.csdn.net/werm520/article/details/49334513

http://justcoding.iteye.com/blog/1948005

如:查找jboss下所有10.19.10.62关键词的文件并替换为10.19.10.210

方法一

[root@jbossfront opt]# grep "10.19.10.62" -rl /opt/jboss | xargs sed -i 's/10.19.10.62/10.19.10.210/g'

方法二,用perl正则表达式

[root@jbossfront opt]# find /opt/jboss/ -type f -print | xargs perl -pi -e 's|10.24.41.136|10.24.41.161|g'

http://www.cnblogs.com/qq78292959/archive/2012/03/08/2385080.html 

Linux 用户管理一

http://13233.blog.51cto.com/3233/82555

Linux 用户管理二

http://13233.blog.51cto.com/3233/82553

Linux 用户管理三

http://13233.blog.51cto.com/3233/82552

Linux 用户管理四

http://13233.blog.51cto.com/3233/82550

Linux 用户管理五

http://13233.blog.51cto.com/3233/82549

http://topic.csdn.net/t/20020816/14/946227.html

http://chenjia66804610.iteye.com/blog/437469

Linux 用户管理 如何在linux下踢人 / Linux 踢用户(pkill)

http://www.yanghengfei.com/archives/223/

http://icarusli.iteye.com/blog/645880

[root@localhost ~]# pkill -kill -t pts/1

[root@localhost ~]# pkill -kill -t pts/2
Linux 用户(user)和用户组(group)管理概述 
http://fedora.linuxsir.org/main/?q=node/91 
用户(User)和用户组(Group)配置文件详解 
http://fedora.linuxsir.org/main/?q=node/98 
Linux 用户(User)查询篇 
http://fedora.linuxsir.org/main/?q=node/105 
Linux 用户管理工具介绍 
http://fedora.linuxsir.org/main/?q=node/106 
Linux 系统中的超级权限的控制 
http://fedora.linuxsir.org/main/?q=node/104 
在Linux系统中,批量添加用户的操作流程 
http://fedora.linuxsir.org/main/?q=node/109

【求助】linux下怎么锁屏?

https://bbs.et8.net/bbs/showthread.php?t=905240

gnome kernel: ctrl+alt+l (快捷键可以在控制中心更改)

kde kernel: ctrl+alt+l (kde里面好像默认没开启)

Fedora 的 KDE 里是缺省设置。 
KDE 菜单 -> 控制中心 -> 区域和辅助功能 -> 键盘快捷键 -> 全局快捷键 -> 桌面 -> 锁住会话
KMenu -> Control Center-> Regional & Accessibility -> Keyboard Shortcuts -> ...

安装xscreensaver包,然后可以用xscreensaver-command -lock 激活屏保。

root用户默认好像不能锁屏,装个xlock就行

-- Linux 批量新建用户

http://daliang1215.iteye.com/blog/816950

文章來源於 sina 煙鬼博客  寫於  2009-05-02 09:59

OS:REDHAT linux AS 5

  1. 首先在/etc/passwd 文件中,查看当前用户,以免一会新建用户跟现有用户重名,从而导致失败,

  [root@localhost ~]vim /etc/passwd

  2.新建文件stu.txt里面内容如下,(注意要和/etc/passwd下的格式一样,否则会出现失败的提示)

/etc/passwd 文件是一个纯文本文件,每行采用了相同的格式:

    name:password:uid:gid:comment:home:shell
说明

name 用户登录名

password用户口令。

此域中的口令是加密的。当用户登录系统时,系统对输入的口令采取相同的算法,与此域中的内容进行比较。如果此域为空,表明该用户登录时不需要口令。

uid 指定用户的 UID。

用户登录进系统后,系统通过该值,而不是用户名来识别用户。

gid 

GID。如果系统要对相同的一群人赋予相同的权利,则使用该值。

comment 

用来保存用户的真实姓名和个人细节。

home 

指定用户的主目录的绝对路径。

shell 

如果用户登录成功,则要执行的命令的绝对路径放在这一区域中。它可以是任何命令。

3.执行命令[root@localhost ~]pwunconv

这样使原来加密的 /etc/passwd 的文件以明码的形式显示。

4.批量添加新用户

[root@localhost ~]newusers stu.txt

这里不用重定向也可以,如果用的话是:newusers < stu.txt

5.添加后的文件为:

6.为新建批量用户设置密码,文件为pass

内容如图: 

7.

设置密码:

[root@localhost ~]chpasswd < pass

这样就把密码都设置给了新用户

8.为所有用户全部加密

[root@localhost ~]pwconv

9.再次查看/etc/passwd文件



 
10.登陆

用新用户登陆:

 

11.批量建用户成功!

-- Linux 批量删除用户

插曲:Linux 批量删除类似文件 / linux 批量删除文件

http://8366.iteye.com/picture/51688

[root@STHV6401 testWIEjb]# find . -name "orbtrc.*"  | xargs rm -rf "orbtrc.*"

[root@localhost /] vi  userdel.sh

#内容如下:

userdel -r test1

userdel -r test2

userdel -r test3

[root@localhost /] sh  userdel.sh

RedHat Linux release 9 (Shrike)

-- 改变用户所属组 /

-- http://www.iteye.com/topic/423753

[root@localhost ~]# usermod -g testgroup testuser    //改变testuser用户组为testgroup
[root@localhost ~]# ls /usr/sbin | grep user
adduser
lnewusers
luseradd
luserdel
lusermod
newusers
sasldblistusers2
useradd
userdel
userhelper
userisdnctl
usermod
usernetctl

#查看当前登录用户

[root@localhost /]# whoami
[root@localhost /]# who
[root@localhost /]# w

[root@localhost /]# logname

# 显示user前n次登陆情况

[root@localhost /]# logname
#查看历史登录用户

[root@localhost /]#last

#查看

http://linux.chinaunix.net/bbs/viewthread.php?tid=271500

useradd和adduser通用,一个是另一个的符号链接。但只有root用户可以使用它个命令。

http://fedora.linuxsir.org/main/?q=node/91

[lindows@localhost lindows]$su     //进入超级用户root

[root@localhost lindows]#exit        //推出超级用户root

//以su方法进入root用户进行:用户“增删改”及用户组“增删改” 是无效的。

//须以 注销 直接用 root 账户登录 进行 用户及其组 赋值 "增删改"等权限。

[root@localhost root]#userdel test     //删除test用户

[root@localhost root]#userdel -r test  //删除test用户及主目录

[root@localhost root]#useradd test   //添加test用户

[root@localhost root]#passwd test    //添加test用户密码

[root@localhost root]#groupdel testgroup                    //删除testgroup用户组

[root@localhost root]#groupdel -d test testgroup        //把test用户从testgroup组中剔除

[root@localhost root]#groupadd -a test testgroup      //把test用户从testgroup组中加入

[root@localhost root]#usermod -g gourp1 test           //改test用户从goup1中加入

[root@localhost root]#cat /etc/passwd      //查看用户列表

RedHat 邮件服务器 devecot 

RHEL5默认使用Dovecot做POP3(S)/IMAP(S)服务器

http://www.itus.cn/network/12/server-56507.shtml

《RHCE Study Guide,5th Edition》第12章译文

http://blog.chinaunix.net/u2/79216/showart_1190398.html

http://blogimg.chinaunix.net/blog/upfile2/081011010034.zip

rrdtool+cacti@lamp笔记整理

http://sinoethic.org/don/2009/03/rrdtoolcactilamp/?

 

Xmanger连接RedHat 启动不了图形界面

redhat图形界面无法启动故障处理

http://blog.chinaunix.net/u/12442/showart_476366.html

RHEL5配置gdm让远程机器登录X window

http://blog.chinaunix.net/u/3177 4/showart_1960590.html

RedHat Linux AS4远程控制管理配置的三种方式

http://daweiangel.iteye.com/blog/508781

redhat xmanager 图形界面解决

解决1:

[root@b2ctestdb ~]# /usr/sbin/gdm --version 
GDM 2.16.0

[root@b2ctestdb ~]# startx 
xauth:  creating new authority file /root/.serverauth.14108
Fatal server error:
Server is already active for display 0
    If this server is no longer running, remove /tmp/.X0-lock
    and start again.
Xlib: connection to ":0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
giving up.
xinit:  unable to connect to X server
xinit:  No such process (errno 3):  Server error.

[root@b2ctestdb ~]# ps -ef | grep gdm 
root      4195     1  0 00:06 ?        00:00:00 /usr/sbin/gdm-binary restart
root      4196  4195  0 00:06 ?        00:00:00 /usr/sbin/gdm-binary restart
root      4198     1  0 00:06 ?        00:00:00 /usr/libexec/gdm-rh-security-token-helper
root      4201  4196  7 00:06 tty7     00:00:00 /usr/bin/Xorg :0 -br -audit 0 -auth /var/gdm/:0.Xauth -nolisten tcp vt7
gdm       4222  4196 13 00:06 ?        00:00:00 /usr/libexec/gdmgreeter
root      4224  4140  0 00:06 pts/1    00:00:00 grep gdm

[root@b2ctestdb ~]# killall gdm

[root@b2ctestdb ~]# pkill gdm

[root@b2ctestdb ~]# /usr/sbin/gdm restart 
[root@b2ctestdb ~]# netstat -an | grep 177 
udp         0      0 0.0.0.0:177                  0.0.0.0:*

解决2

[root@teps ~]cp /usr/share/gdm/defaults.conf /usr/share/gdm/defaults.conf.bak20100317

[root@teps ~]vi /usr/share/gdm/defaults.conf

修改如下内容

[xdmcp]  

263 Enable=true 或 Enable=1

279 DisplaysPerHost=10

284 Port=177

[security] 
214 AllowRemoteRoot=true 
# 最后关闭防火墙

[root@teps ~] service iptables stop

[root@teps ~] service iptables status

Firewall is stopped.

ok

RedHat 安全管理

http://lindows.iteye.com/admin/blogs/663049

RedHat 7.2 关闭防火墙 / - 获得root 控制权限。在“#”下操作。

- 查看防火墙状态。

[root@Loadrunner19 ~]#  systemctl status firewalld

- 临时关闭防火墙命令。重启电脑后,防火墙自动起来。

[root@Loadrunner19 ~]#  systemctl stop firewalld

- 永久关闭防火墙命令。重启后,防火墙不会自动启动。

[root@Loadrunner19 ~]#  systemctl disable firewalld

- 打开防火墙命令。

[root@Loadrunner19 ~]#  systemctl enable firewalld

- 查看防火墙规则

[root@Loadrunner19 ~]#  iptables -L

- 清除防火墙规则

[root@Loadrunner19 ~]#  iptables -F  

10.19.95.19 

[root@Loadrunner19 wyg]# ls -l /root/wyg/*

-rwxr-xr-x 1 root root    236 Jun 11  2012 /root/wyg/CheckPort.sh

-rwxr-xr-x 1 root root    150 Jun 11  2012 /root/wyg/CheckTCPPortStat.sh

-rw-r--r-- 1 root root   1999 Jun  7  2012 /root/wyg/function.inc

-rwxr-xr-x 1 root root    237 Jun 11  2012 /root/wyg/GetProcCpu.sh

-rwxr-xr-x 1 root root    450 Jun 11  2012 /root/wyg/GetProcDes.sh

-rwxr-xr-x 1 root root    458 Jun 11  2012 /root/wyg/GetProcMem.sh

-rwxr-xr-x 1 root root    282 Jun 11  2012 /root/wyg/GetProcPid.sh

-rwxr-xr-x 1 root root   2797 Jun 11  2012 /root/wyg/MonSystem.sh

-rwxr-xr-x 1 root root 227324 Jan  3  2014 /root/wyg/RPSPREDB.snapshot_sql.2014-01-03-16.17.03

-rwxr-xr-x 1 root root     88 Jan 14  2014 /root/wyg/testExit.sh

-rwxr-xr-x 1 root root    642 Jan 13  2014 /root/wyg/testMem.sh

-rwxr-xr-x 1 root root   7887 Oct 29  2013 /root/wyg/transfer.pl

-rw-r--r-- 1 root root  17381 Jan  3  2014 /root/wyg/transfer.txt

/root/wyg/splunk:

total 4

drwx------ 3 root root 4096 Feb 24  2014 splunk

[root@Loadrunner19 wyg]# more CheckPort.sh 

#!/bin/bash

. ./function.inc

if [ $# -ne 1 ]
then
{
	echo "Need input the port"
	exit 0;
}
fi

isListen=`Listening $1`

if [ $isListen -eq 1 ]
then
{
    echo "The port is listening"
}
else
{
    echo "The port is not listening"
}
fi 

 [root@Loadrunner19 wyg]# more CheckTCPPortStat.sh 

#!/bin/bash

. ./function.inc

if [ $# -ne 1 ]
then
{
	echo "Need input the port"
	exit 0;
}
fi

output=`Chech_Tcp_Server_Port_Stat $1`

echo $output

 [root@Loadrunner19 wyg]# more GetProcCpu.sh 

#!/bin/bash

. ./function.inc

if [ $# -ne 2 ]
then
{
	echo "Need the user name and process parameters"
	exit 0;
}
fi
	
PID=`GetPID $1 $2`

if [ "-$PID" == "-" ]
then
{
    echo "The process is not found"
}
else
{
    CheckCpu $PID
}
fi 

[root@Loadrunner19 wyg]# more GetProcDes.sh 

#!/bin/bash

. ./function.inc

if [ $# -ne 2 ]
then
{
	echo "Need the user name and process parameters"
	exit 0;
}
fi

PID=`GetPID $1 $2`

if [ "-$PID" == "-" ]
then
{
    echo "The process is not found"
}
else
{
    des=`GetDes $PID`

    echo "The number of des is $des"

    if [ $des -gt 900 ]
    then
    {
         echo "The number of des is larger than 900"
    }
    else
    {
        echo "The number of des sis normal"
    }
    fi
}
fi 

[root@Loadrunner19 wyg]# more GetProcMem.sh 

#!/bin/bash

. ./function.inc

if [ $# -ne 2 ]
then
{
	echo "Need the user name and process parameters"
	exit 0;
}
fi

PID=`GetPID $1 $2`

if [ "-$PID" == "-" ]
then
{
    echo "The process is not found"
}
else
{
    mem=`GetMem $PID`

    echo "The usage of memory is $mem M"

    if [ $mem -gt 1600 ]
    then
    {
         echo "The usage of memory is larger than 1.6G"
    }
    else
    {
        echo "The usage of memory is normal"
    }
    fi
}
fi

 [root@Loadrunner19 wyg]# more GetProcPid.sh 

#!/bin/bash


. ./function.inc

if [ $# -ne 2 ]
then
{
	echo "Need the user name and process parameters"
	exit 0;
}
fi

PID=`GetPID $1 $2`
if [ "-$PID" == "-" ]
then
{
      echo "The process does not exist."
}
else
{
      echo "The process exist."
	  echo "It's id is $PID"
}
fi

[root@Loadrunner19 wyg]# more MonSystem.sh

#!/bin/bash

. ./function.inc

#Whether to monitor the disk space. 0: no,1: yes
IS_MO_SYS_SPACE=1
#Whether to detect the system CPU.0: no,1: yes
IS_MO_SYS_CPU=1
#Interval for monitoring the system: second
S_MO_CHK_INTERVAL=60
#Number of times for continuously monitoring the system.
S_MO_CHK_TIMES=3
#Maximum Usage of the system space
MAX_SYS_SPACE_USE=90
#Maximum CPU usage of the system.
MAX_SYS_CPU_USE=70

Host_Name=`hostname`
CheckDiskDir[0]="/dev"
CheckDiskDir[1]="/boot"


while true
do
{
    if [[ $IS_MO_SYS_SPACE -eq 1 ]]
    then
    {
        C=0
        for CheckDisk in ${CheckDiskDir[@]}
        do
        {
            CheckTime=$S_MO_CHK_TIMES
            while (( CheckTime > 0 ))
            do
            {
                DiskSpaceNum=`GetDiskSpc ${CheckDiskDir[$C]}`
                if [[ "-$DiskSpaceNum" = "-" ]]
                then
                {
                    echo "Diretory(${CheckDiskDir[$C]}) is not exist."
                    break
                }
                fi

                if [ $DiskSpaceNum -le $MAX_SYS_SPACE_USE ]
                then
                {
                    echo "Current DiskSpace[${CheckDiskDir[$C]}] is $DiskSpaceNum%."
                    break
                }
                fi

                echo "Current DiskSpace[${CheckDiskDir[$C]}] $DiskSpaceNum% is more than $MAX_SYS_SPACE_USE%."
                (( CheckTime = CheckTime - 1 ))

                if [ $CheckTime -eq 0 ]
                then
                {
                    echo "continue check $S_MO_CHK_TIMES times but DiskSpace[${CheckDiskDir[$C]}][$DiskSpaceNum%] is more than $MAX_SYS_SPACE_USE% yet." 
                    echo "Send Alarm about the DIsk Space"
                    break
                }
                fi

                sleep $S_MO_CHK_INTERVAL
            }
            done

            ((C+=1))
            continue;
        }
        done
    }
    fi

    if [[ $IS_MO_SYS_CPU -eq 1 ]]
    then
    {
        CheckTime=$S_MO_CHK_TIMES
        while (( CheckTime > 0 ))
        do
        {
            CpuNum=`GetSysCPU`
            if [ $CpuNum -le $MAX_SYS_CPU_USE ]
            then
            {
               echo "Current CPU $CpuNum%."
               break
            }
            fi

            echo "SYSCPU:Current CPU $CpuNum% is more than $MAX_SYS_CPU_USE%."
            (( CheckTime = CheckTime - 1 ))

            if [ $CheckTime -eq 0 ]
            then
            {
               echo "continue check $S_MO_CHK_TIMES times but SYSCPU[$CpuNum%] is more than $MAX_SYS_CPU_USE% yet."
               echo "Send Alarm about the system CPU"
               break
            }
            fi

            sleep $S_MO_CHK_INTERVAL
         }
         done
    }
    fi

    sleep $S_MO_CHK_INTERVAL
}
done

 

 [root@Loadrunner19 wyg]# more testExit.sh 

#!/bin/bash
echo "test 1"

if (1<2) then 
{
 echo "test 2"
 exit 1
}
fi

echo "test 3"

[root@Loadrunner19 wyg]# more testMem.sh 

#! /bin/bash
echo -n "PidName " > /root/script/pid.f
echo "MeMery " >> /root/script/pid.f
PIDPATH=/proc/
TOTLE=0
cd $PIDPATH
DOC=`ls`
for DOCNAME in $DOC
do
if [ -d $DOCNAME ]; then
cd $DOCNAME
if [ -f status ];then
MEMERY=`grep VmRSS status | awk -F':' '{print $2}' | awk '{print $1}'`
PIDNAME=`grep Name status | awk -F':' '{print $2}'`
if [ $MEMERY ]; then
echo -n $PIDNAME >> /root/script/pid.f
echo -n " " >> /root/script/pid.f
echo $MEMERY >> /root/script/pid.f
TOTLE=`expr $TOTLE + $MEMERY`
cd ..
else
cd ..
fi
else
cd ..
fi
fi
done
TOTLE=`expr $TOTLE / 1024`
echo "TOTLE USERD: $TOTLE MB" >> /root/script/pid.f
cat /root/script/pid.f

 [root@Loadrunner19 wyg]# more transfer.pl 

#Transfer snapshot.txt to stmt.txt


use strict;
use IO::File;
use Time::Local;

#Open the snapshot.txt
unless (open(FILE1,$ARGV[0])) {
die ("Please enter the snapshot.txt\n");
}



my $date;
my $line;
my @array;
my $NumberExecutions;
my $NumberCompilations;
my $WorstPreparation;
my $BestPreparation;
my $TotalExecutionTime;
my $InternalRowsDeleted;
my $InternalRowsInserted;
my $InternalRowsupdated;
my $StatementText;
my $Statementsorts;
my $Statementsortoverflows;
my $Totalsorttime;
my $Rowsread;
my $AverageRowRead;
my $Rowswritten;
my $AverageRowSelect;
my $BPDLR;
my $BPDPR;
my $BPILR;
my $BPIPR;
my $BPTDLR;
my $BPTDPR;
my $BPTILR;
my $BPTIPR;
my $BPRatio;
my $flag = 0;
my $position;
my $AverageTime;
my $TUsrTm;
my $TSysTm;


#Show start time.
$date=localtime(time);
print "Start from ".$date;

#Write the tag to the txt.
open (OUTFILE, ">transfer.txt");
print OUTFILE (" NumEx;NumComp;WorstP;BestP;IntRDel;IntRIns;RowsRead;IntRUpd;RowsWri;Sorts;SortOflo;TSortTm;BPDLR;BPDPR;BPTDLR;BPTDPR;BPILR;BPIPR;BPTILR;BPTIPR;TELapTm;TUsrTm;TSysTm;AvgElap;AverageRowRead;AverageRowSelect;BPRatio;Text;\n");

#Close the file handle.
close(OUTFILE);
print("\nBegin to transfer,please wait!\n");

#Read the data from snapshot.txt.
while($line = <FILE1>)
{
	if($line=~/Number\sof\sexecutions/){
		$NumberExecutions=$line;
		$position=index($NumberExecutions,"=");
		$NumberExecutions=substr($NumberExecutions,$position+1,);	
		if($NumberExecutions=~/\s0.*\s/){
			$flag=1;
			$NumberExecutions="";
			next;
		}else{	
			
			$flag=2;
			#print $NumberExecutions;
		}
		$NumberExecutions=~s/\s//g;
	}
	if($line=~/Number\sof\scompilations/ && $flag==2){
		$NumberCompilations=$line;
		$position=index($NumberCompilations,"=");
		$NumberCompilations=substr($NumberCompilations,$position+1,);
		$NumberCompilations=~s/\s//g;
		#print $NumberCompilations;
	}	
	if($line=~/Worst\spreparation\stime/ && $flag==2){
		$WorstPreparation=$line;
		$position=index($WorstPreparation,"=");
		$WorstPreparation=substr($WorstPreparation,$position+1,);
		$WorstPreparation=~s/\s//g;
		#print $WorstPreparation;
	}
	if($line=~/Best\spreparation\stime/ && $flag==2){
		$BestPreparation=$line;
		$position=index($BestPreparation,"=");
		$BestPreparation=substr($BestPreparation,$position+1,);
		$BestPreparation=~s/\s//g;
		#print $BestPreparation;
	}
	if($line=~/Internal\srows\sdelete/ && $flag==2){
		$InternalRowsDeleted=$line;
		$position=index($InternalRowsDeleted,"=");
		$InternalRowsDeleted=substr($InternalRowsDeleted,$position+1,);
		$InternalRowsDeleted=~s/\s//g;
		#print $InternalRowsDeleted;
	}
	if($line=~/Internal\srows\supdated/ && $flag==2){
		$InternalRowsupdated=$line;
		$position=index($InternalRowsupdated,"=");
		$InternalRowsupdated=substr($InternalRowsupdated,$position+1,);
		$InternalRowsupdated=~s/\s//g;
		#print $InternalRowsupdated;
	}
	if($line=~/Internal\srows\sinserted/ && $flag==2){
		$InternalRowsInserted=$line;
		$position=index($InternalRowsInserted,"=");
		$InternalRowsInserted=substr($InternalRowsInserted,$position+1,);
		$InternalRowsInserted=~s/\s//g;
		#print $InternalRowsInserted;
	}
	if($line=~/Statement\ssorts/ && $flag==2){
		$Statementsorts=$line;
		$position=index($Statementsorts,"=");
		$Statementsorts=substr($Statementsorts,$position+1,);
		$Statementsorts=~s/\s//g;
		#print $Statementsorts;
	}
	if($line=~/Statement\ssort\soverflows/ && $flag==2){
		$Statementsortoverflows=$line;
		$position=index($Statementsortoverflows,"=");
		$Statementsortoverflows=substr($Statementsortoverflows,$position+1,);
		$Statementsortoverflows=~s/\s//g;
		#print $Statementsortoverflows;
	}
	if($line=~/Total\ssort\stime/ && $flag==2){
		$Totalsorttime=$line;
		$position=index($Totalsorttime,"=");
		$Totalsorttime=substr($Totalsorttime,$position+1,);
		$Totalsorttime=~s/\s//g;
		#print $Totalsorttime;
	}
	if($line=~/Total\sexecution\stime/ && $flag==2){
		$TotalExecutionTime=$line;	
		$position=index($TotalExecutionTime,"=");
		$TotalExecutionTime=substr($TotalExecutionTime,$position+1,);
		$TotalExecutionTime=~s/\s//g;
		#print $TotalExecutionTime;
	}
	if($line=~/Rows\sread/ && $flag==2){
		$Rowsread=$line;	
		$position=index($Rowsread,"=");
		$Rowsread=substr($Rowsread,$position+1,);
		$Rowsread=~s/\s//g;
		#print $Rowsread;
	}
	if($line=~/Rows\swritten/ && $flag==2){
		$Rowswritten=$line;	
		$position=index($Rowswritten,"=");
		$Rowswritten=substr($Rowswritten,$position+1,);
		$Rowswritten=~s/\s//g;
		#print $Rowswritten;
	}
	if($line=~/Buffer\spool\sdata\slogical\sreads/ && $flag==2){
		$BPDLR=$line;	
		$position=index($BPDLR,"=");
		$BPDLR=substr($BPDLR,$position+1,);
		$BPDLR=~s/\s//g;
		#print $BPDLR;
	}
	if($line=~/Buffer\spool\stemporary\sdata\slogical\sreads/ && $flag==2){
		$BPTDLR=$line;	
		$position=index($BPTDLR,"=");
		$BPTDLR=substr($BPTDLR,$position+1,);
		$BPTDLR=~s/\s//g;
		#print $BPTDLR;
	}
	if($line=~/Buffer\spool\sdata\sphysical\sreads/ && $flag==2){
		$BPDPR=$line;	
		$position=index($BPDPR,"=");
		$BPDPR=substr($BPDPR,$position+1,);
		$BPDPR=~s/\s//g;
		#print $BPDPR;
	}
	if($line=~/Buffer\spool\stemporary\sdata\sphysical\sreads/ && $flag==2){
		$BPTDPR=$line;	
		$position=index($BPTDPR,"=");
		$BPTDPR=substr($BPTDPR,$position+1,);
		$BPTDPR=~s/\s//g;
		#print $BPTDPR;
	}
	if($line=~/Buffer\spool\sindex\slogical\sreads/ && $flag==2){
		$BPILR=$line;	
		$position=index($BPILR,"=");
		$BPILR=substr($BPILR,$position+1,);
		$BPILR=~s/\s//g;
		#print $BPILR;
	}
	if($line=~/Buffer\spool\stemporary\sindex\slogical\sreads/ && $flag==2){
		$BPTILR=$line;	
		$position=index($BPTILR,"=");
		$BPTILR=substr($BPTILR,$position+1,);
		$BPTILR=~s/\s//g;
		#print $BPTILR;
	}
	if($line=~/Buffer\spool\sindex\sphysical\sreads/ && $flag==2){
		$BPIPR=$line;	
		$position=index($BPIPR,"=");
		$BPIPR=substr($BPIPR,$position+1,);
		$BPIPR=~s/\s//g;
		#print $BPIPR;
	}
	if($line=~/Buffer\spool\stemporary\sindex\sphysical\sreads/ && $flag==2){
		$BPTIPR=$line;	
		$position=index($BPTIPR,"=");
		$BPTIPR=substr($BPTIPR,$position+1,);
		$BPTIPR=~s/\s//g;
		#print $BPTIPR;
	}
        if($line=~/Total\suser\scpu\stime/ && $flag==2){
		$TUsrTm=$line;	
		$position=index($TUsrTm,"=");
		$TUsrTm=substr($TUsrTm,$position+1,);
		$TUsrTm=~s/\s//g;
		#print $TUsrTm;
	}
        if($line=~/Total\ssystem\scpu\stime/ && $flag==2){
		$TSysTm=$line;	
		$position=index($TSysTm,"=");
		$TSysTm=substr($TSysTm,$position+1,);
		$TSysTm=~s/\s//g;
		#print $TSysTm;
	}	
	if($line=~/Statement\stext/ && $flag==2){
		$StatementText=$line;
		$position=index($StatementText,"=");
		$StatementText=substr($StatementText,$position+1,);
		#print $StatementText;
	}
	else{
		next;
	}
	if($flag==2){
	$AverageTime=sprintf("%.15f", ($TotalExecutionTime)/($NumberExecutions));
	$AverageRowRead=sprintf("%.5f", ($Rowsread)/($NumberExecutions));
		if($Rowsread==" 0"||$Rowswritten==" 0"){
			$AverageRowSelect=0;
		}else{
			$AverageRowSelect=sprintf("%.5f", ($Rowswritten)/($Rowsread));
		}
		if(($BPDLR+$BPILR)==0||($BPIPR+$BPDPR)==0){
			$BPRatio=100;
		}else{
			$BPRatio = (1-($BPIPR+$BPDPR)/($BPDLR+$BPILR))*100;
		}
	open (OUTFILE, ">>transfer.txt");
	print OUTFILE ($NumberExecutions.";".$NumberCompilations.";".$WorstPreparation.";".$BestPreparation.";".$InternalRowsDeleted.";".$InternalRowsInserted.";".$Rowsread.";".$InternalRowsupdated.";".$Rowswritten.";".$Statementsorts.";".$Statementsortoverflows.";".$Totalsorttime.";".$BPDLR.";".$BPDPR.";".$BPTDLR.";".$BPTDPR.";".$BPILR.";".$BPIPR.";".$BPTILR.";".$BPTIPR.";".$TotalExecutionTime.";".$TUsrTm.";".$TSysTm.";".$AverageTime.";".$AverageRowRead.";".$AverageRowSelect.";".$BPRatio.";".$StatementText);

	$StatementText="";
	$TotalExecutionTime="";
	$NumberExecutions="";
	$Statementsorts="";
	$Statementsortoverflows="";
	$Totalsorttime="";
	$TUsrTm="";
	$TSysTm="";
	}
}

#Show end time.
$date=localtime(time);
print "End at ".$date;

#Close the file handle.
close(OUTFILE);
close(FILE1)

http://www.futurehandw.com/db2_performance/db2-%E6%80%A7%E8%83%BD%E4%B9%8B%E6%97%85%E4%BA%94 

DB2 性能之旅(二)中提到了使用DB2的snapshot分析,发现现行的snapshot分析工具非常差。

有空的时候,Jason自己code了一个perl脚本,可以快速的分析snapshot,由于DB2的snapshot的内容比较大,perl处理速度还有待加强,呵呵。

我们需要装有ActivePerl-5.8.8.822-MSWin32-x86-280952(free)或更高版本的环境来执行脚本。

使用命令行执行transfer.pl,后面参数为您snapshot的路径。例如:”transfer.pl d:\perl\all.txt”.

开始执行后,在perl脚本的文件夹中会生成transfer.txt,然后你就可以用新建的excel文件打开transfer.txt,注意用分号隔开(Delimited with Semicolon)。

以将程序上传到sourceforge上,下载地址如下:

这里。

Jason近期会上传定时爬虫抓取weblogic页面的程序。

———EOF———

作者: 吴颖敏 | www.futurehandw.com

Email: wuyingminhui@gmail.com 

Linux 图形界面 / exportDISPLAY=:0.0的解释

http://www.2cto.com/os/201404/293597.html

在Linux/Unix类操作系统上, DISPLAY用来设置将图形显示到何处. 直接登陆图形界面或者登陆命令行界面后使用startx启动图形, DISPLAY环境变量将自动设置为:0:0, 此时可以打开终端, 输出图形程序的名称(比如xclock)来启动程序, 图形将显示在本地窗口上, 在终端上输入printenv查看当前环境变量, 输出结果中有如下内容:

DISPLAY=:0.0

使用xdpyinfo可以查看到当前显示的更详细的信息.

DISPLAY 环境变量格式如下host:NumA.NumB,host指Xserver所在的主机主机名或者ip地址, 图形将显示在这一机器上, 可以是启动了图形界面的Linux/Unix机器, 也可以是安装了Exceed, X-Deep/32等Windows平台运行的Xserver的Windows机器. 如果Host为空, 则表示Xserver运行于本机, 并且图形程序(Xclient)使用unix socket方式连接到Xserver,而不是TCP方式. 使用TCP方式连接时, NumA为连接的端口减去6000的值, 如果NumA为0, 则表示连接到6000端口; 使用unix socket方式连接时则表示连接的unix socket的路径, 如果为0, 则表示连接到/tmp/.X11-unix/X0 . NumB则几乎总是0.

如果使用su username或者su - username切换到别的用户, 并且使用命令

export DISPLAY=:0.0

设置DISPLAY环境变量, 运行图形程序(如xclock)时会收到如下错误:

Xlib: connection to ":0.0"refused by server

Xlib: No protocol specified

Error: Can't open display: :0.0

这是因为Xserver默认情况下不允许别的用户的图形程序的图形显示在当前屏幕上. 如果需要别的用户的图形显示在当前屏幕上, 则应以当前登陆的用户, 也就是切换身份前的用户执行如下命令

xhost +

[root@Loadrunner19 ~]# xhost +

access control disabled, clients can connect from any host

这个命令将允许别的用户启动的图形程序将图形显示在当前屏幕上.

在2台Linux机器之间, 如果设置服务器端配置文件/etc/ssh/sshd_config中包含:

X11Forwarding no

客户端配置文件/etc/ssh/ssh_config包含:

ForwardX11 yes

则从客户端ssh到服务器端后会自动设置DISPLAY环境变量, 允许在服务器端执行的图形程序将图形显示在客户端上. 在服务器上查看环境变量显示如下(这个结果不同的时候并不相同)

DISPLAY=localhost:10.0

在客户机上用netstat -lnp可以看到有程序监听了6010端口

tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 4827/1

如果希望允许远程机器上的图形程序将图形显示在本地机器的Xserver上, 除了要设置远端机器的DISPLAY环境变量以外, 还需要设置本地机器的Xserver监听相应的TCP端口. 而现在的Linux系统出于安全的考虑, 默认情况下不再监听TCP端口. 可通过修改/etc/X11/xinit/xserverrc文件, 将

exec /usr/bin/X11/X -dpi 100 -nolistentcp

修改为

exec /usr/bin/X11/X -dpi 100

允许在直接使用startx启动图形时启动对TCP端口的监听.

修改/etc/kde3/kdm/kdmrc, 将

ServerArgsLocal=-nolisten tcp

修改为

ServerArgsLocal=

允许kdm作为显示管理器时, 启动会话时监听相应的TCP端口.

修改/etc/gdm/gdm.conf, 在[Security]一节增加

DisallowTCP=false

或者在登陆窗口选择"Options" -> "Configure Login Manager..."的Security页面, 取消"DenyTCP connections to Xserver", 允许gdm作为显示管理器时, 启动会话时监听相应的TCP端口.

 

end

原文地址:https://www.cnblogs.com/lindows/p/14390462.html