怎么增加网站浏览量,新手怎样在手机上做电商,软件网络推广方案,网站建设开发外包公司要求#xff1a; 1、shell 脚本写出检测 /tmp/size.log 文件如果存在显示它的内容#xff0c;不存在则创建一个文件将创建时间写入。 2、写一个 shel1 脚本,实现批量添加 20个用户,用户名为user01-20,密码为user 后面跟5个随机字符。 3、编写个shel 脚本将/usr/local 日录下…要求 1、shell 脚本写出检测 /tmp/size.log 文件如果存在显示它的内容不存在则创建一个文件将创建时间写入。 2、写一个 shel1 脚本,实现批量添加 20个用户,用户名为user01-20,密码为user 后面跟5个随机字符。 3、编写个shel 脚本将/usr/local 日录下大于10M的文件转移到/tmp目录下 要求1
代码
if [ -f /tmp/size.log ]; thencat /tmp/size.log
elseecho $(date) /tmp/size.log
fi
结果 要求2
代码
for ((i 1; i 20; i)); dousernameuser$(printf %02d $i)passworduser$(cat /dev/urandom | tr -dc a-zA-Z0-9 | fold -w 5 | head -n 1)useradd -m -p $(openssl passwd -1 $password) $usernameecho User $username created with password: $password
done 结果 要求3
代码
#!/bin/bash
for file in /usr/local/*; doif [ -f $file ]; thensize$(du -m $file | awk {print $1})if [ $size -gt 10 ]; thenmv $file /tmpecho Moved $file to /tmpfifi
done
结果