常用工具连接

http://os.51cto.com/linuxman/   Linux 中文men

http://rpmfind.net/linux/RPM/   RPM包下载

=================================================================

Bash 快捷键

ctrl+L   清屏

ctrl+C

ctrl+U  删除光标之前的命令  ------ ctrl +Y

ctrl +K  删除光标之后的命令

ctrl +R  历史命令搜索

ctrl +D 退出当前终端

=================================================================

修改ssh,加快远程登录的速度

[root@axwaydemo ~]# vim /etc/ssh/sshd_config

UseDNS no  (yes 改为no)

#service sshd restart    重启SSH服务

=================================================================

配置本地yum源

[root@axwaydemo ~]# cat /etc/yum.repos.d/dvd.repo
[1]
name=1
baseurl=file:///mnt/
gpgcheck=0
enabled=1
[root@axwaydemo ~]#

=================================================================

egrep -v "#|^$" httpd.conf   去掉 注释及空格

自动挂载windows共享

[root@localhost ~]# cat /etc/rc.local
touch /var/lock/subsys/local 
mount.cifs -o username="administrator",password="123.com" //192.168.2.88/g/yum/centos6.5/ /mnt/share

yum安装后的文件不删除

[root@localhost ~]# vim /etc/yum.conf   将其中 keepcache=0改为keepcache=1,保存退出

linux显示选定行的上下10行

grep -B 10 -A 10  text  inputfile
-B before
-A after

取IP地址:grep -Eo "\<[0-9]*(\.[0-9]*){3}\>" file 取方括号内容: awk 'BEGIN{RS="]";FS="["}NF>1{print $NF}' file