บันทึกของฮองมู

chmod

修改文件或目录的访问权限

100% การประมวลผลภายในเบราว์เซอร์ 0 การอัพโหลดข้อมูล

ตัวอย่างที่ใช้บ่อย

授予所有者[u]执行[x]文件的权限

chmod u+x {{文件}}

授予所有者[u]读[r]和写[w]文件或目录的权限

chmod u+rw {{文件或目录}}

移除用户组[g]的文件执行[x]权限

chmod g-x {{文件}}

授予所有用户[a]读[r]以及执行[x]文件的权限

chmod a+rx {{文件}}

授予其他用户[o](不在所有者用户组)和用户组[g]同样的权限

chmod o=g {{文件}}

移除其他用户[o]的所有权限

chmod o= {{文件}}

递归授予用户组[g]和其他用户[o]目录下所有文件和子目录的写[w]权限

chmod {{[-R|--recursive]}} g+w,o+w {{目录}}

递归授予所有用户[a]目录下文件的读[r]权限和子目录的执行[X]权限

chmod {{[-R|--recursive]}} a+rX {{目录}}

หมายเหตุ: วงเล็บปีกกา{{…}}เป็นพารามิเตอร์ที่ต้องเปลี่ยนแปลง (เช่น เส้นทาง ชื่อไฟล์ เป็นต้น) คำสั่งจะถูกดำเนินการเฉพาะบนเทอร์มินัลของเครื่องนี้เท่านั้น โดยเว็บไซต์นี้จะไม่บันทึกข้อมูลที่ป้อนเข้ามาใดๆ

การเปรียบเทียบกับต้นฉบับภาษาอังกฤษ

เปิดเผยคำอธิบายและตัวอย่างภาษาอังกฤษ (ที่มา: tldr-pages)

Change the access permissions of a file or directory. More information

Give the [u]ser who owns a file the right to e[x]ecute it

chmod u+x {{path/to/file}}

Give the [u]ser rights to [r]ead and [w]rite to a file/directory

chmod u+rw {{path/to/file_or_directory}}

Remove e[x]ecutable rights from the [g]roup

chmod g-x {{path/to/file}}

Give [a]ll users rights to [r]ead and e[x]ecute

chmod a+rx {{path/to/file}}

Give [o]thers (not in the file owner's group) the same rights as the [g]roup

chmod o=g {{path/to/file}}

Remove all rights from [o]thers

chmod o= {{path/to/file}}

Change permissions recursively giving [g]roup and [o]thers the ability to [w]rite

chmod {{[-R|--recursive]}} g+w,o+w {{path/to/directory}}

Recursively give [a]ll users [r]ead permissions to files. Also give e[X]ecute permissions to files that have at least one execution permission and to all sub-directories

chmod {{[-R|--recursive]}} a+rX {{path/to/directory}}

ข้อมูลคำสั่ง

ชื่อคำสั่งchmod
วัตถุประสงค์修改文件或目录的访问权限
แพลตฟอร์มที่รองรับ通用
จำนวนตัวอย่าง8 บทความ
เอกสารทางการhttps://www.gnu.org/software/coreutils/manual/html_node/chmod-invocation.html
แหล่งข้อมูลtldr-pages(CC-BY-4.0)· คำแปลภาษาจีนของชุมชน

คำถามที่พบบ่อย

chmod คำสั่งทำหน้าที่อะไร?

修改文件或目录的访问权限

chmod ใช้อย่างไร?

หน้าเว็บจัดแสดงตามสถานการณ์8ตัวอย่างที่ใช้บ่อย: สำหรับแต่ละตัวอย่าง จะเริ่มจากการระบุวัตถุประสงค์ จากนั้นจึงแสดงคำสั่งที่สมบูรณ์ซึ่งสามารถคัดลอกใช้ได้โดยตรง (พารามิเตอร์ที่ต้องแทนที่จะอยู่ภายในวงเล็บดอกไม้)

chmod การดำเนินการที่ใช้บ่อยที่สุดคืออะไร?

授予所有者[u]执行[x]文件的权限: :chmod u+x {{文件}}

วงเล็บปีกกาในคำสั่งหมายถึงอะไร?

วงเล็บดอกไม้{{…}}หมายถึงจำเป็นต้องแทนที่ด้วยค่าของคุณเอง เช่น เส้นทางหรือชื่อไฟล์; วงเล็บของพารามิเตอร์ที่มีชื่อเดียวกัน (เช่น[-C|--directory])แสดงว่าเป็นรูปแบบการเขียนที่เลือกใช้ได้