此脚本是用来批量创建用户并设置用户密码,在企业用非常实用. 脚本一 #!/bin/bash for name in $( seq 1 100 ) do useradd "user$name" if [ $? -eq 0 ];then echo -e "\n创建 "user$name" 成功!" fi done 添加100用户在users组,并设置密码为user 脚本二 i=1 for (1..100) do groupadd users addu
1. 统计的对象words.txt,每个单词占一行(从简考虑了~) zjd@ubuntu:~/test$ cat word.txt used this count mysql count this used mysql linux this redis apple android redis apple 2. 统计每个单词的频率 方法1: zjd@ubuntu:~/test$ cat word.txt |awk '{a[$0]++}END{for(i in a) print i"="
查看当前日期以及登陆用户: cat test1: #!/bin/bash # This script displays the date and who's logged on echo -n The time and date are: date echo "Let's see who's logged into the system:" who 添加执行权限:chmod u+x test1 执行./test1,得带结果如下: The :: CST Let's see who's l