查看当前日期以及登陆用户: 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
useradd apachephp vi /etc/httpd/conf/httpd.conf 将组和用户修改成apachephp,重启apache,然后用lsof -i:80查看apache的执行用户是否更改成功 修改/etc/sudoers文件,快捷命令为visudo ## Allow root to run any commands anywhereroot ALL=(ALL) ALL apachephp ALL=(ALL) NOPASSWD: ALL (注
#输入:固定格式的用户数据user.sql #处理:循环读取user.sql中的每行(每行对应一条用户数据),依次调用curl命令将用户插入BearyChat #输出:执行结果输出到日志文件outlog.txt #版本:V1. num= for line in `cat errorData.sql` do #截断 IFS=',' arr=($line) #body参数赋值 domainid=${arr[]}; domainname=${arr[]}; username=${arr[]}; use
shell脚本?在说什么是shell脚本之前,先说说什么是shell. shell是外壳的意思,就是操作系统的外壳.我们可以通过shell命令来操作和控制操作系统,比如Linux中的Shell命令就包括ls.cd.pwd等等.总结来说,Shell是一个命令解释器,它通过接受用户输入的Shell命令来启动.暂停.停止程序的运行或对计算机进行控制. shell 是一个应用程序,它连接了用户和 Linux 内核,让用户能够更加高效.安全.低成本地使用 Linux 内核,这就是 Shell 的本质. s