寻找文件
介绍
有一个非常重要的文件(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