Get the App
SLTechnology News&Howtos  ›  Servers  › 

Use the chmod command of linux to change file or directory permissions

Shulou Source: shulou.com Published: 2022-06-02 12:45:07 10月22日 Update

Editor to share with you the use of linux chmod command to change the file or directory permissions, I believe that most people do not know much, so share this article for you to learn, I hope you will learn a lot after reading this article, let's go to learn the method!

The chmod command means "change the permissions mode of a file" in English, and we call it "change mode" for short, which means a command used to change the permissions of a file or directory, but only the owner and superuser root of the file can execute this command. There are two modes, one is to use permission letters and operator expressions, the other is to use numbers.

Syntax format: chmod [parameters] [file]

Common parameters:

-c if the file permissions have indeed been changed, only show its change action-f if the file permission cannot be changed and does not display an error message-v displays the details of the permission change-R makes the same permission change for all files and subdirectories in the current directory (that is, change it one by one by recursion)

Reference example

Set the file file1.txt to be accessible to everyone:

[root@linuxcool ~] # chmod astatr file.txt

Make all files and subdirectories in the current directory readable by anyone:

[root@linuxcool] # chmod-R aquir *

Set file.txt to be executed only by the owner of the file:

[root@linuxcool] # chmod uplix file.txt above is all the contents of changing the permissions of a file or directory using the chmod command of linux. Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Files permissions commands directories learning content parameters only subitems subdirectories same not much action original meaning most letters learning methods examples commonly used meaning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Microsoft Xiaomi OPPO Reno Apple