Find a File Introduction
There is a very important file (sources.list) but you forget where it is, you vaguely remember it in the/etc/directory, now you want to find out this file, and then set it to be accessible to you, but other users cannot access
Goal
- Locate Sources.list File
- Change the file owner to yourself (Shiyanlou)
- Modify the permissions to only be readable and writable
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 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 2016/etc/apt/sources.list
Linux seek file change owner change name