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 ...
随机推荐
- css实现鼠标移入table时出现滚动条且table内容不移位
一般是这样: 表格的标题和内容分别由一个table组成,其中表格内容的table由一个class="table-body"的div包裹.css如下 .tContainer .tab ...
- 3 Longest Substring Without Repeating Characters(最长不重复连续子串Medium)
题目意思:求字符串中,最长不重复连续子串 思路:使用hashmap,发现unordered_map会比map快,设置一个起始位置,计算长度时,去减起始位置的值 eg:a,b,c,d,e,c,b,a,e ...
- linux 配置 sphinx 全文搜索引擎
因为公司网站需要,最近在弄sphinx搜索引擎,也是遇到各种问题,最终终于解决了. 服务器系统:centos7 (64位) 详情看安装官网的安装教程进行 coreseek 3.2.14 这里只提一些注 ...
- php 5.2 版本isset()方法小坑
PHP 5.2.17p1 (cli) (built: May 28 2015 16:15:30)Copyright (c) 1997-2010 The PHP GroupZend Engine v2. ...
- 嵌入式学习笔记(虚拟机共享文件夹配置-Ubuntu系统中)
最近在学习Linux的操作系统,使用的是虚拟机.由于一些文件需要在主机和虚拟机中都要编辑,如果可以使得文件共享,可以极大的提高工作效率! 配置共享文件的步骤如下: [第一步] 在虚拟机软件中设置 [第 ...
- 栈的顺序存储方式的C语言实现
/* 编译器:Dev-c++ 5.4.0 文件名:stack.cpp 代码版本号:1.0 时间:2015-10-10 20:08:54 */ #include <stdio.h> #inc ...
- 『Python』 ThreadPool 线程池模板
Python 的 简单多线程实现 用 dummy 模块 一句话就可以搞定,但需要对线程,队列做进一步的操作,最好自己写个线程池类来实现. Code: # coding:utf-8 # version: ...
- cf C. Divisible by Seven
http://codeforces.com/contest/376/problem/C 题意:给你一个大数最多含有10^6个数字,这里面必须含有1,6,8,9,然后重新排列找出一个能被6整除的数. 思 ...
- 两种解法-树形dp+二分+单调队列(或RMQ)-hdu-4123-Bob’s Race
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4123 题目大意: 给一棵树,n个节点,每条边有个权值,从每个点i出发有个不经过自己走过的点的最远距离 ...
- MyEclipse10 中增加svn插件
http://www.cnblogs.com/bluesky4485/archive/2012/04/23/2467177.html 确实这种方法可行!向牛人学习!