#!/bin/bash
#自动配置bond
#byliuq
MODPROBE="/sbin/modprobe"
cd/etc/sysconfig/network-scripts
if[-fifcfg-eth0]
then
cpifcfg-eth0/tmp/ifcfg-eth0.bak
cpifcfg-eth1/tmp/ifcfg-eth1.bak
ETH0=eth0
ETH1=eth1
elif[-fifcfg-em0]
then
cpifcfg-em1/tmp/ifcfg-em1.bak
..
分类:
系统相关 时间:
2015-12-25 19:28:31
阅读次数:
206
在当前用户目录下新建.bash_profile文件,执行以下命令:vi .bash_profile然后保存,输入命令 :wq最后使命令生效,执行命令 source .bash_profile
分类:
系统相关 时间:
2015-12-25 13:05:01
阅读次数:
1270
#!/bin/bash##测试环境LAMP用YUM快速部署。##注释###LAMP配置文件路径:#1、/etc/httpd/conf/httpd.conf#2、/etc/my.cnf#3、/etc/php.ini#php网站目录:/var/www/html/#1、安装LAMP依赖环境yum-yinstallgccgcc-c++makeauthconfautomakelibtoollibeventlibevent-develncursenucr..
分类:
其他好文 时间:
2015-12-25 06:36:48
阅读次数:
256
打开终端,输入:vi~/.bash_profile输入i然后粘贴以下内容# mysqlalias mysql='/usr/local/mysql/bin/mysql'alias mysqladmin='/usr/local/mysql/bin/mysqladmin'# lsalias ls='ls ...
分类:
数据库 时间:
2015-12-24 23:38:28
阅读次数:
174
近期bash漏洞在网上闹得沸沸扬扬的,我也修补一下。以防万一。须要用到的命令:查看操作系统版本号:cat /etc/issue查看bash版本号:bash -version查看操作系统是64位还是32位:sudo uname --m须要修复的ubuntu版本号及bash版本号:ubuntu 14.0...
分类:
其他好文 时间:
2015-12-24 22:18:27
阅读次数:
193
1.查看当shell中变量:本地和环境变量的命令:set 查看当前shell中的环境变量:printenv/env/export2.变量存入到内存中是字符串3.#!/bin/bash 覆盖重定向 >> 追加重定向 2> 错误覆盖重定向 2>>错误追加重定向 &> 全部重定向6.管道:管道...
分类:
系统相关 时间:
2015-12-24 20:41:22
阅读次数:
187
一、故障现象使用脚本:#!/bin/bash
declare-aarr
arr=($(echo"showslavestatus\G"|/usr/local/mysql/bin/mysql-uroot-pDdFour_123|grep-E‘Running|Error‘|awk‘{print$2}‘))
if[${arr[0]}==‘No‘-o${arr[1]}==‘No‘];then
zabbix_sender-z172.16.200.46-p10051-sdd4_mysql_slav..
分类:
数据库 时间:
2015-12-24 19:30:40
阅读次数:
861
redis自动安装脚本:
安装目录:/usr/local/redis
二进制文件:/usr/local/bin
配置文件:/usr/local/redis/etc,配置文件自己根据自身的业务去配置,这里只是一个空文件.
日志文件:/usr/local/redis/logs
数据文件:/usr/local/redis/dump
#!/bin/bash
Soft_dir="/home/tools"
Dow..
分类:
其他好文 时间:
2015-12-24 16:38:06
阅读次数:
275
【前言】练习shell,提高逻辑能力。【脚本】三角形与菱形均通过几个for循环实现,当然也可以用while。下面是脚本内容:[三角形]#!/bin/bash
read-p"pleaseinputthelongs:"long
for((i=1;i<=$long;i++))
do
for((j=$long;j>i;j--))#控制空格输出
do
echo-n""
done
formin`..
分类:
系统相关 时间:
2015-12-24 10:48:09
阅读次数:
1007
shell:外壳(是用户能直接操作系统资源的入口)shell一般分两种:图形界面GUI:gnome,kde,xfce命令行界面CLI:sh、csh、ksh、bash、tcsh、zsh进程:在每个进程看来,当前主机上只存在内核和当前进程。进程是运行中的程序,程序只有一个但是进程却可以有多个shell和子shell:..
分类:
其他好文 时间:
2015-12-24 00:53:27
阅读次数:
168