摘要: 创建软链接 ln -s [源文件或目录] [目标文件或目录] 例如: 当前路劲创建 test 引向 /var/www/test 文件夹 ln -s /var/www/test test 创建 /var/test 引向 /var/www/test 文件夹 ln -s /var/www/test /va 阅读全文
posted @ 2020-01-08 10:37 Zsecret 阅读(417) 评论(0) 推荐(0) 编辑
摘要: [root@ localhost shell]# vim useradd.sh #!/bin/bash for ((i=1;i<=5;i+1)) do cat /etc/passwd|grep user$i #查看用户是否存在、 if [ $? -eq 0 ]; then echo "用户已存在" 阅读全文
posted @ 2020-01-07 16:59 Zsecret 阅读(329) 评论(0) 推荐(0) 编辑
摘要: [root@ localhost shell]# vim s6.sh #!/bin/bash for i in {1..3} do read -p "请输入第${i}个数:" number${i} done echo "$number1,$number2,$number3" a=0 if [ $nu 阅读全文
posted @ 2020-01-07 16:50 Zsecret 阅读(513) 评论(0) 推荐(0) 编辑
摘要: [root@ localhost shell]# vim s5.sh #!/bin/bash name=`whoami` echo $name if [ $name -ne "root" ];then echo "对不起,您不是管理员" else yum -y install vsftpd fi 阅读全文
posted @ 2020-01-07 16:28 Zsecret 阅读(364) 评论(0) 推荐(0) 编辑
摘要: [root@ localhost shell]# touch {1..10}.txt [root@ localhost shell]# ls 10.txt 1.txt 2.txt 3.txt 4.txt 5.txt 6.txt 7.txt 8.txt 9.txt s1.sh s2.sh s4.sh 阅读全文
posted @ 2020-01-07 15:57 Zsecret 阅读(2167) 评论(0) 推荐(0) 编辑
摘要: 第一种方法: [root@ localhost shell]# vim s8.sh #!/bin/bash for i in `ls *.$1` do mv $i ${i%.*}.$2 done 第二种方法: [root@ localhost shell]# vim s81.sh #!/bin/ba 阅读全文
posted @ 2020-01-07 15:47 Zsecret 阅读(276) 评论(0) 推荐(0) 编辑
摘要: -A -A参数指定客户端的用户代理标头,即User-Agent。curl 的默认用户代理字符串是curl/[version]。 $ curl -A 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like G 阅读全文
posted @ 2020-01-07 11:36 Zsecret 阅读(1584) 评论(0) 推荐(0) 编辑
摘要: [root@ localhost ~]# vim useradd.sh #!/bin/bash #$1 是执行脚本的第一个参数,$2 是执行脚本的第二个参数 useradd "$1" echo "$2" | passwd --stdin "$1" #执行脚本 [root@ localhost ~]# 阅读全文
posted @ 2020-01-07 10:44 Zsecret 阅读(814) 评论(0) 推荐(0) 编辑
摘要: 1、关闭防火墙 [root@izbp176gmws1f6cpbllwouz ~]# systemctl stop firewalld [root@izbp176gmws1f6cpbllwouz ~]# setenforce 0 2、配置nginx的yum源 [root@izbp176gmws1f6c 阅读全文
posted @ 2020-01-03 20:26 Zsecret 阅读(156) 评论(0) 推荐(0) 编辑
摘要: [root@izbp176gmws1f6cpbllwouz ~]# vim check.sh #!/bin/bash function system(){ echo "#####################系统信息########################" OS_TYPE=`uname` 阅读全文
posted @ 2019-12-30 11:52 Zsecret 阅读(170) 评论(0) 推荐(0) 编辑