中标麒麟系统把玩记录

1、指令发送邮件

echo "content"|mail -vs "this is title" -a a.sh [email protected]

其中,content代表发送的内容,thisistitle代表邮件主题,a.sh为附件

2、开机运行脚本

在etc/init.d下新建脚本sendmail.sh,输入内容并赋予权限(chmod +x sendmail.sh)

首先在init.d目录下输入runlevel查看等级,确定为5后对应的是rc5.d

(好像不用加软连接,加了后收到两封。。)然后建立软连接:ln -s /etc/init.d/sendmail.sh /etc/rc5.d/S99sendmail.sh

3、终端记录保存到文件

以ls指令为例

ls|tee -a /home/a.txt

发布了30 篇原创文章 · 获赞 20 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/yinuoheqian123/article/details/103599576
今日推荐