zoukankan      html  css  js  c++  java
  • linux修改文件所属的用户组以及用户

    linux修改文件所属的用户组以及用户

    将文件夹从A用户(huangxf)目录复制B用户(zhenglf)目录,其中B没有sudo权限。
    将A的Downloads文件夹下的所有文件,复制到B的Documents文件夹下,
    此时在Documents文件夹下多了一个Downloads文件夹


    可使用以下命令,将sourceDir文件夹拷贝到destDir文件夹下:
    cp sourceDir/ destDir/ -rf


    在A用户的终端执行
    sudo  cp  -R  /home/huangxf/Downloads/   /home/zhenglf/Documents/Downloads/


    修改所有者
    sudo  chown  -R  zhenglf  /home/zhenglf/Documents/Downloads/


    修改用户组
    sudo  chgrp  -R  zhenglf  /home/zhenglf/Documents/Downloads/


    此时B用户是复制过来的文件拥有者,在B用户的终端可以对此文件修改权限
    修改文件权限
    chmod  -R  777  /home/zhenglf/Documents/Downloads/
  • 相关阅读:
    50
    49
    Windows编程之connect函数研究
    48
    C++创建窗口程序初步
    47
    46
    45
    计算机组成原理实验思路
    44(function pointer 2)
  • 原文地址:https://www.cnblogs.com/xy51/p/13445181.html
Copyright © 2011-2022 走看看