How does Linux give file permissions? Skills of adding executable permissions to files in Linux

Time:2022-1-24

If we want to run such a file, we need to add an executable permission to the file separately. How can we add an executable file to the file? The access rights of files or directories are divided into read-only, write only and executable. Let’s take a look at the detailed operation process.

Log in to the Linux system and create a new terminal

Use in terminalTouch commandCreate a file

Use VIM editor, write some content in the file, enter: WQ save exit

Return to the terminal,Use LS – L to view file permissions

useThe Chmod command and the + X parameter give the file executable permissions

X here represents executable permissions (read, write and executable permissions are represented by R, W and X respectively); And that a means all, that is, the permission values of users, user groups and other users are modified (if only one of the three identities of user, user group and other users is modified, the letter a can be replaced by u, g or o); The plus sign in front of X indicates adding permission (if you remove a permission, it is the English minus sign).

staysendUse the LS – L command to view the file permission attribute to have executable permission, you can run it using the absolute path of the file

The above is the technique of Linux adding executable permissions to files. I hope you like it. Please continue to pay attention to developeppaer.

Relevant recommendations:

What is the difference between file permissions of Linux system and windows system?

How does the Ubuntu system view the version? Tips for viewing Linux system version information

How does deepin Linux switch to root? Tips for deepin to switch root users

Recommended Today

JVM + GC parsing (premise knowledge concatenation)

Premise preparation JVM GC garbage collection JVM virtual machine monitoring, tuning and troubleshooting Tomcat and microservice optimization 1. Premise review 1.1. JVM memory structure 1.1.1、 JVM Architecture Overview The gray part in the figure isThread private, there is almost no garbage collectionOrange partThread sharing, the main place where garbage recycling occurs What is the class […]