#配置静态地址网卡
Device= "Eth0"
Bootproto=static
Hwaddr= "00:0c:29:dc:ea:f7"
Nm_controlled= "Yes"
Onboot=yes
ipaddr=192.168.227.140
netmask=255.255.255.0
gateway=192.168.227.1
Type=ethernet
#SHH登陆系统
SSH [email protected]
#查看网卡mac地址
DMESG | grep "ETH"
#查看当前挂在设备
Cat/proc/partitions
#查看硬盘和阵列卡驱动
Modinfo Megaraid_sas
#SCP网络拷贝命令-Copy files locally to another host
SCP boot.img [Email protected]:/root/
#SCP网络拷贝命令--other hosts to copy files locally
SCP [Email protected]:/date/boot.img/tmp/
#SCP网络拷贝命令--Copy the folder locally to another host
Scp-r Test.tar [Email protected]:/root/
#配置静态DNS
Vi/etc/resolv.conf
NameServer 8.8.8.8
#查看文件大小
Du-h--max-depth=1/root/test/
#更改linux语言
vi/etc/sysconfig/i18n
#关闭selinux
Vi/etc/selinux/config
Change into selinux=disabled
Setenforce 1 setting SELinux to be enforcing mandatory mode
Setenforce 0 setting SELinux into Permissiveg shutdown mode
#关闭防火墙
Chkconfig iptables on
Chkconfig iptables off
Service Iptables Start
Service Iptables Stop
#修改主机名
Vi/etc/sysconfig/network
Networking=yes
Hostname= Host Name
#linux多链路聚合软件
Service Multipath Start
#查看linux系统版本
Cat/etc/issue
#查看CPU型号版本
Cat/proc/cpuinfo
#查看PCI设备
Lspci
#查看内科版本
Uname-a
#Linux自身文件数据
/usr/share/doc
#调试模式bash进入sh
Chroot/mnt/sysimage
#重新挂载
Mount-n-O REMOUNT,RW/
Mount-o REMOUNT,RW/
#开机自动挂载
Vi/etc/rc.local
Mpunt/dev/sdc/caiwu
#自动挂载分区
Vi/etc/fstab
/dev/sdc/caiwu EXT4 Defaults 0 0
#查看磁盘分区信息 (where/dev/hda IDE hard drive/DEV/SDA1 SATA or SCSI hard drive)
Fdisk-l
#Linux DVD test exists in boot: down input memtest86
Shortcut keys for #X Window logoff
Ctrl+alt+backsoace
#修改linux系统时间
Date-s 07/30/2009
Date-s 22:24:30
Clock-w
#修改SSH注销时间
Vi/etc/hosts.allow
Next add sshd:all restart SSH on the line
#查看事都安装RPM包
Rpm-qa |grep GCC
#查看网卡驱动和固件版本
Ethtool-i eth0
#查看正在使用的进程
Ps-ef|grep Hpaculi
#查找boot目录下面小于2M字节的文件已ls-LH show up.
find/boot/-size-2m-exec ls-lh {} \;
#打包文件 Package/boot into Test.tar in the/tmp directory
Tar cvf/tmp/test.tar/boot
#解包文件 unzip the Test.tar under the/tmp directory to/ROOT/HP
Tar-xvf/tmp/test.tar-c/ROOT/HP
#压缩/boot files to/tmp/test.tar.gz
Tar-zcvf/tmp/test.tar.gz/boot
#解压到当前目录
Tar zxvf/tmp/test.tar.gz
#打包文件 Package/boot into test.tar.bz2 in the/tmp directory
Tar jcvf/tmp/test.tar.bz2/boot
#解压 test.tar.bz2 to/root/test under the TMP directory
Tar jxvf/tmp/test.tar.bz2-c/root/test
#网络复制命令
SCP [Email protected]:/tmp/zxl/root/
#查看主机SN号
Dmidecode-t 1
#查看服务器网卡固件和驱动
Ethtool-i eth0
#开机自动挂在monut-A
Nano/etc/fstab
/DEV/HDC6/MNT/HDC6 ext3 defaults 0 0
#可是 Read Only form 忞
Mount-n-O REMOUNT,RW/
#挂载ISO文件
Mount-o Loop/hp/hp2003.iso/mnt/iso
# See if the NIC is linked
Mii-tool
# View Linux Group Cat/etc/group
Add Group Groupadd HGBW
USERADD-G Group name User name
# View all users in Linux
cat/etc/passwd
# How to modify the access rights of a file
Chmod-r 777
# view commands used in the past
History
#后台管理查看
Jobs
#启用后台程序
BG 2
#将后台放在前台
FB 2
#搜索之前使用过的参数
Ctrl+r
#yum搜索
Yum Search VNC
#查看yum已经安装的文件
Yum List installed
#测试硬盘读写
DD If=/dev/zero of=/export/ddtest bs=1024k count=1000 oflag=direct
#执行检测shell
Sh-x oracle.sh
#查找etc文件夹下面所有有eth0的文件
grep ' eth0 ' $ (find/etc-type f)
#查看本机IP地址
Ifconfig eth0 | grep "inet addr" | Sed ' s/^.*inet addr://g ' | Cut-d '-f1
#更换网卡后需要处理MAC地址变更
Rm-f/etc/udev/rules.d/70-persistent-net.rules
Linux OPS Notes