linux命令chown修改文件所有权
Changing User Ownership
To apply appropriate permissions, the first thing to consider is ownership. To do this, there is the chown command. The syntax of this command is not hard to understand:
■ chown who what
For instance, the following command changees ownership for the file account to user linda:
■ chown linda account
The chown command has a few options, of which one is particularly useful: -R . You might guess what it does, because this option is available for many other commands as well. It allows you to set ownership recursively, which allows you to set ownership of the current directory and everything below. The following command changes ownership for the directory /home and everything beneath it to user linda:
■ chown -R linda /home/linda
Changing Group Ownership
There are actually two ways to change group ownership. You can do it using chown , but there is also a specific command with the name chgrp that does the job. If you want to use the chown command, use a . or : in front of the group name. The following changes the group owner of directory /home/account to the group account:
chown .account /home/account
You can use chown to change user and/or group ownership in a number of ways, an overview of which follows:
■ chown lisa myfile Sets user lisa as the owner of myfile
■ chown lisa.sales myfile Sets user lisa as user owner and group sales as group owner of myfile
■ chown lisa:sales myfile Sets user lisa as user owner and group sales as group owner of myfile
■ chown .sales myfile Sets group sales as group owner of myfile without changing the user owner
■ chown :sales myfile Sets group sales as group owner of myfile without changing the user owner
You can also use the chgrp command to change group ownership. Consider the following example, where you can use chgrp to set group ownership for the directory / home/account to the group account:
■ chgrp account /home/account
As is the case for chown , you can use the option -R with chgrp as well to change group ownership recursively.
linux命令chown修改文件所有权的更多相关文章
- Linux 命令 - chown: 更改文件的所有者和所属群组
chown 命令用来更改文件或者目录的所有者和所属群组.使用这个命令需要超级用户的权限. 命令格式 chown [OPTION]... [OWNER][:[GROUP]] FILE... chown ...
- linux中如何修改文件夹的用户权限 chown命令
linux中,可以使用chown命令来修改文件夹的用户权限. 1. 以普通用户 A 登录linux,利用su -切换到root用户 2. 在root用户下,可以看到文件夹内容 3. 但通过文件系统, ...
- linux ,mac连接, git pull error, chmod修改文件的权限/chown修改文件和目录的所有者
去项目目录下 启动服务 setsid npm start & Mac下如何用SSH连接远程Linux服务器 https://www.cnblogs.com/littleBit/p/536280 ...
- linux系统下修改文件夹目录权限
linux系统下修改文件夹目录权限 文件夹权限问题 Linux.Fedora.Ubuntu修改文件.文件夹权限的方法差不多.很多人开始接触Linux时都很头痛Linux的文件权限问题.这里告诉大家如何 ...
- Linux下批量修改文件及文件夹所有者及权限
Linux下批量修改文件及文件夹所有者及权限需要使用到两个命令,chmod以及chown 例:对/opt/Oracle/目录下的所有文件与子目录执行相同的权限变更: chmod -R 700 /opt ...
- 【转】linux查看及修改文件权限以及相关
linux查看及修改文件权限以及相关 查看文件权限的语句: 在终端输入: ls -l xxx.xxx (xxx.xxx是文件名) 那么就会出现相类似的信息,主要都是这些: -rw-rw-r-- 一共有 ...
- Linux命令行修改IP、网关、DNS、主机名 的方法
修改主机名:[改里面的 HOSTNAME 即可] vim /etc/sysconfig/network 网卡eth0 IP修改为 102.168.0.1 ifconfig eth0 102.16 ...
- Linux命令行修改IP、网关、DNS的方法
Linux中在命令行中修改IP地址.网关.DNS的方法. 网卡eth0 IP修改为 102.168.0.1 复制代码代码如下: ifconfig eth0 102.168.0.1 netmask ...
- 分布式进阶(十) linux命令行下载文件以及常用工具:wget、Prozilla、MyGet、Linuxdown、Curl、Axel
linux命令行下载文件以及常用工具:wget.Prozilla.MyGet.Linuxdown.Curl.Axel 本文介绍常用的几种命令行式的下载工具:wget.Prozilla.MyGet.Li ...
随机推荐
- linux之umask函数解析
[lingyun@localhost umask_1]$ vim umask.c + umask.c ...
- 137 Single Number II(找唯一数Medium)
题目意思:一个int数组,有一个数只出现一次,其他数均出现三次,找到这个唯一数 思路: 1.将所有数用2进制表示,计算每一位的数字和 1*3*n1+0*3*n2+c 唯一数对应位的数字(0或者1 ...
- CSS3中更灵活的布局方式
flex是一个灵活性强的布局方式,它能够很好的控制内部元素的宽度,高度或者剩余的空间部分,来适应不同的显示设备和不同的屏幕尺寸,而真正达到一种自适应效果. flex布局与常规布局截然不同,常规布局虽然 ...
- __PUBLIC__模板文件路径配置
__PUBLIC__ 默认指向 项目文件下的Public文件夹 注意: __PUBLIC__不是一个常量,只在模板中进行替换,__ROOT__是一个常量 项目文件路径 defined('__PUBLI ...
- 初学Javascript对象
<script> var p=new Object(); //属性 p.width=; p.height=; p.num=; p.autotime=; //方法 p.autoplay=fu ...
- Delphi-Copy 函数
函数名称 Copy 所在单元 System 函数原型 1 function Copy ( Source : string; StartChar, Count : Integer ) : string ...
- 探究Android中Listview显示错乱问题
问题 最近在项目中遇到过一个很棘手的问题,就是ListView在滑动后就莫名其妙的显示错乱,网上查阅资料后问题很容易的就解决了,但是对于问题产生的原因仍是一知半解,所以不甘心的我定下心来,狠读源码,终 ...
- spinner 下拉框控件
spinnerMode=dropdown时,为下拉模式spinnerMode=dialog时,会在界面中间弹出Android:popupBackground=”#f0000000”,可以去除spinn ...
- 添加、设置tabBarItem属性
//tabbarItem正常状态的属性 NSMutableDictionary *nor = [NSMutableDictionary dictionary]; nor[NSForegroundCol ...
- 委托的lambda表达式
委托可以用 Lambda 表达式的方法来表示,很多C#的代码都会大量使用 Lambda 表达式,正确理解它的用法还是很重要的. 基础规则: Lambda 运算符 “=>” 左边表示委托实例所需要 ...