vim /etc/init.d/mytest #!/bin/sh echo "$(pwd) and $USER and $(whoami)" >> /root/temp/1.txt; mkdir -p /root/temp/; cd /root/temp/; echo "$(pwd) and $USER and $(whoami)" >> 2.txt sudo chmod a+x /etc/init.d/mytest sudo update-…
如果将在linux中将命令或者程序设置为开机自动启动,只需要进入到将对应命令加入到/etc/rc.d/rc.local文件里即可,如下 打开文件,vi /etc/rc.d/rc.local #!/bin/sh## This script will be executed *after* all the other init scripts.# You can put your own initialization stuff in here if you don't# want to do th…