摘要:本文主要向大家介绍了Linux运维知识之linux 寻找文件 改所有者 改名字,通过具体的内容向大家展现,希望对大家学习Linux运维知识有所帮助。
本文主要向大家介绍了Linux运维知识之linux 寻找文件 改所有者 改名字,通过具体的内容向大家展现,希望对大家学习Linux运维知识有所帮助。
介绍
有一个非常重要的文件(sources.list)但是你忘了它在哪了,你依稀记得它在/etc/目录下,现在要你把这个文件找出来,然后设置成自己可以访问,但是其他用户并不能访问
目标
找到sources.list文件
把文件所有者改为自己(shiyanlou)
把权限修改为仅仅只有自己可读可写
shiyanlou:~/ $ find /etc/ -name source.list [21:00:23]
find: `/etc/ssl/private': \u6743\u9650\u4e0d\u591f
shiyanlou:~/ $ sudo find /etc/ -name sources.list [21:00:48]
/etc/apt/sources.list
shiyanlou:~/ $ chown shiyanlou /etc/apt/sources.list [21:01:22]
chown: \u6b63\u5728\u66f4\u6539"/etc/apt/sources.list" \u7684\u6240\u6709\u8005: \u4e0d\u5141\u8bb8\u7684\u64cd\u4f5c
shiyanlou:~/ $ sudo chown shiyanlou /etc/apt/sources.list [21:01:52]
shiyanlou:~/ $ ll /etc/apt/sources.list [21:02:15]
-rw-r--r-- 1 shiyanlou root 2.0K 8\u6708 17 2016 /etc/apt/sources.list
shiyanlou:~/ $ chmod 600 /etc/apt/sources.list [21:02:29]
shiyanlou:~/ $ ll /etc/apt/sources.list [21:03:09]
-rw------- 1 shiyanlou root 2.0K 8\u6708 17 2016 /etc/apt/sources.list
本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注系统运维Linux频道!
您输入的评论内容中包含违禁敏感词
我知道了
请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号