12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
编程知识 时间:2024-11-19 11:55:47
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
在Ubuntu中,rc.local文件默认是不启用的,如果需要启用并使用rc.local文件,可以按照以下步骤操作:打开终端,输入以下命令打开rc.local文件进行编辑:sudo nano /etc/rc.local在rc.lo
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
在Ubuntu中,rc.local文件默认是不启用的,如果需要启用并使用rc.local文件,可以按照以下步骤操作:
sudo nano /etc/rc.local
#!/bin/sh -e## rc.local## This script is executed at the end of each multiuser runlevel.# Make sure that the script will "exit 0" on success or any other# value on error.## In order to enable or disable this script just change the execution# bits.## By default this script does nothing.# Print the IP address_IP=$(hostname -I) || trueif [ "$_IP" ]; thenprintf "My IP address is %s\n" "$_IP"fiexit 0
保存并退出rc.local文件。在nano编辑器中,按下Ctrl+X,然后按Y确认保存,最后按Enter键确认文件名。
授予rc.local文件执行权限,输入以下命令:
sudo chmod +x /etc/rc.local
sudo reboot
之后,系统启动时,rc.local文件中添加的命令或脚本将会自动执行。
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19