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

本文详细介绍了如何在Linux系统中通过rc.local脚本实现脚本执行、NTFS分区加载及权限设置,包括创建文件、添加内容、赋权、启用服务及检查日志,适合系统管理员和开发者参考。
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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值