Linux初步学习(文件权限的三个命令)
2015-10-11 10:22
471 查看
Linux初步学习
基本的三个命令的学习chmod
chown
chgrp
先来看一幅图
1.修改文件的拥有者 chown
目前拥有者和组别都是root
[code]xth@ubuntu:~/Code/C$ ls -l test1.c -rw-r--r-- 1 root root 0 Oct 10 07:08 test1.c
我们现在修改该文件的拥有者
[code]//首先必须切换到管理员 root@ubuntu:/home/xth/Code/C# chown Yy test1.c root@ubuntu:/home/xth/Code/C# ls -l test1.c -rw-r--r-- 1 Yy root 0 Oct 10 07:08 test1.c
这样拥有者就变成Yy这个用户了
2.修改文件组拥有者 chgrp
test1.c这个文件的组拥有者是root 我们修改一下:
[code]root@ubuntu:/home/xth/Code/C# chgrp xth test1.c root@ubuntu:/home/xth/Code/C# ls -l test1.c -rw-r--r-- 1 Yy xth 0 Oct 10 07:08 test1.c
组拥有者就是xth这个组了
3.修改文件的权限 chmod
目前拥有者的权限是读和写 组拥有者和其他用户的权限是读。
我们修改如下:
拥有者:读写和执行(rwx)
组拥有者:写和执行(-wx)
其他用户:没有权限(—)
[code]root@ubuntu:/home/xth/Code/C# chmod u+x,g-r+w+x,o-r test1.c root@ubuntu:/home/xth/Code/C# ls -l test1.c -rwx-wx--- 1 Yy xth 0 Oct 10 07:08 test1.c
所以
拥有者->u
组拥有者->g
其他->o
+号就是增加权限 -号我就不说了。
2015年10月11日10:22:10
相关文章推荐
- JDK环境变量配置(linux)
- Linux集群-负载均衡lvs-dr实现mysql
- linux 串口工具的安装
- 虚拟机安装麒麟3.2时报unkown filesystem,you need to load the linux kernel first
- linux系统下sd卡的备份与恢复
- linux常用命令总结
- linux(centos)下非root用户执行管理命令
- 每天一个linux命令(11):nl命令
- Linux 命令 - top: 动态显示进程信息
- Linux配置端口为80
- archlinux 时间同步问题
- linuxmint下vmware 12启用3D加速
- Linux中变量$#,$@,$0,$1,$2,$*,$$,$?的含义
- 有关于kali linux安装eclipse出现的一系列问题
- Eclipse的git插件EGit在Linux上提交时的问题与解决
- 阿里云linux服务器如何挂载数据盘
- Linux开发中,make命令的使用
- RHEL 7 & CentOS 7禁用IPV6 的影响!
- 再来说说linux中重要的alias命令------从findcpp命令说起
- Visual EmbedLinux Tools 更新到 0.1.7