Linux seek file change owner change name

Source: Internet
Author: User

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
    1. Locate Sources.list File
    2. Change the file owner to yourself (Shiyanlou)
    3. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.