ubuntu 启动运行脚本 与 fstab加载ntfs分区并使用回收站

  • Post author:
  • Post category:其他


1.创建文件 rc.local
sudo vim /etc/rc.local
2.复制下列内容到 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.
echo "测试脚本执行成功" > /home/yanxiang/test.log
exit 0
3.给 rc.local 加上权限,启用服务
sudo chmod 755 /etc/rc.local
sudo systemctl enable rc-local
4.启动服务并检查状态
sudo systemctl start rc-local.service
sudo systemctl status rc-local.service
5.重启后检查test.log文件是否已经存在

fstab 加载ntfs分区并使用回收站

UUID=31A11AA52A01DC26 /media/yanxiang/Data           ntfs    defaults,locale=en_US.UTF-8,uid=1000,gid=1000        0       2

查询分区的UUID

sudo blkid



版权声明:本文为yxsoft2011原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。