linux从0开始
从0开始学习Linux
迟夏暮语
这个作者很懒,什么都没留下…
展开
-
for循环批量创建用户
// 准备一个用户名称列表文件,比如user.txt,通过for循环读取 read -p "Enter the users Passwd :" PASSWD for UNAME in `cat user.txt` do id $UNAME & /dev/null if [[ $? -eq 0 ]] then echo "Already exists" else userad...原创 2020-04-02 08:27:04 · 528 阅读 · 0 评论 -
使用shell监测服务器是否可以正常连接
// A code block var foo = 'bar'; // ping -c 代表发送数据包的个数 -i代表每0.2秒发一个数据包 -W 则为3秒及超时 #!/bin/bash ping -c 3 -i 0.2 -W 3 $1 &>/dev/null if [[ $? -eq 0 ]] then echo "host $1 is up" else echo "host...原创 2020-04-01 11:06:46 · 341 阅读 · 0 评论