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.