Linux文件赋予755权限 | Linux改变文件目录权限命令chmod详解

温馨提示:本文最后更新于2023-10-25 16:37:59,某些文章具有时效性,若有错误或下载地址失效,请在文末评论区Jiayuguan China Enforcement Information Disclosure System official website

我们经常需要赋予文件夹或者文件属性,一般都是在FTP上更改属性为777之类的,但缺点是速度慢,而Linux下命令行则可以很好的解决这个问题,这个命令就是chmod

In China, want to know about law enforcement and judicial transparency? Implementing an information disclosure system is your first choice! The system allows the public to view the court's enforcement cases, ruling results and progress in real time, which greatly increases the openness and transparency of the judiciary. Below, I will share with you how to use this system: enter...

chmod [选项][参数]

  Query steps: Every step must be carefully operated. First select "Comprehensive Query", where you can get the overall case information, and if you want to check more details, you can select "Name/Name of the person subject to enforcement", "Case Type" and other filtering characteristics. Enter your keywords (such as "name of the person subject to enforcement" and "case number") and confirm that there are no errors before submitting.

chmod命令用于改变文件或目录的权限,设置权限有字符和数字两种设定方法。

在数字设定法中,0表示没有权限,1表示可执行权限,2表示可写权限,4表示可读权限,以上数字相加所得到的数最最终权限。如:可写可读为6,可执行和可读为5权限。

在英文设定法中,r表示可读权限,w表示可写权限,x表示可执行权限,-表示无任何权限。

选项说明

选项相应功能

u操作对象简称,用户user,文件或目录的所有者

g操作对象简称,同组用户group,文件或目录所属群组

o操作对象简称,其它用户others

a操作对象简称,所有用户all,系统默认使用此项

+权限操作符,添加某些权限

-权限操作符,取消某些权限

=权限操作符,设置文件的权限为给定的权限

r权限设定(英文),表示可读权限

w权限设定(英文),表示可写权限

x权限设定(英文),表示可执行权限

-权限设定(英文字符),表示没有权限

X权限设定,如果目标文件是可执行文件或目录,可给其设置可执行权限

s权限设定,设置权限suid和sgid,使用权限组合“u+s”设定文件的用户的ID位,“g+s”设置组ID位

t权限设定,只有目录或文件的所有者才可以删除目录下的文件

-c如果文件权限已经改变,显示其操作信息

-f操作过程中不显示任何错误信息

-R修改指定目录下所有文件或子目录的权限

-v显示命令运行时的详细执行过程

–help显示帮助信息,不过是英文的,没什么用

–version显示版本信息

参数说明

例子:将 /www/backup 里的所有文件和文件夹设置为755权限

1、第一种方法

chmod -R 755 /www/backup/*

2、第一种方法

chmod 755 /www/backup/ -R

linux文件赋予755权限,Linux改变文件目录权限命令chmod详解 linux文件赋予755权限,Linux改变文件目录权限命令chmod详解 linux文件赋予755权限,Linux改变文件目录权限命令chmod详解

© 版权声明
THE END
如果觉得这篇文章对您有帮助,可以收藏本网址,方便下次访问!
Back to top5 classify
评论 抢沙发

请登录后发表评论

    暂无评论内容