Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the concept of linux executable

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

Most people do not understand the knowledge points of this article "what is the concept of linux executable", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "what is the concept of linux executable" article.

There are two meanings of executable in linux: 1, for a file, it means that the file has the permission to be executed by the system; whether the file can be executed is to see if the file has x permissions, and if so, the file is an executable file. 2. For directories, the user can enter the directory on behalf of the user, and the user with x permission can use the cd command to switch directories.

The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

Everything in linux is files, folders, new hard drives. Can look at the file to deal with ah, all have permissions, respectively, read, write and executable.

But in fact, the same permission has different meanings for files and directories.

The effect of read (r), write (w) and executable (x) permissions on files

Files are used to store data in the system, including ordinary text files, database files, binary executable files, and so on. The meaning of different permissions for the file is shown in Table 1.

Table 1 the role of rwx permissions on files the role of rwx permissions on files read permissions (r) indicates that the actual contents of this file can be read, for example, you can execute file view commands such as cat, more, less, head, tail, etc. Write permission (w) means that you can edit, add, or modify the contents of the file, for example, you can execute vim, echo and other commands to modify the file data. Note that no permission does not give the user the right to delete a file unless the user has write permission to the parent directory of the file. Execute permission (x) indicates that the file has permissions to be executed by the system. Whether a file is executable in Window system is checked by extension (.exe, .bat, etc.), but in Linux system, whether a file can be executed is determined by whether the file has x permission. That is, as long as the file has x permission, the file is an executable. However, whether the file can run correctly depends on whether the code in the file is correct.

Execution permission is the highest permission for a file. When setting permissions to users or groups, whether or not to grant execution permissions needs to be carefully considered, otherwise it will have a serious impact on the system installation.

The effect of read (r), write (w) and executable (x) permissions on directories

Directory, mainly used to record the list of file names, the effect of different permissions on the directory is shown in Table 2.

Table 2 the effect of rwx permissions on directories the role of rwx permissions on directories read permissions (r) indicate permission to read a list of directory structures, that is, you can see what files and subdirectories are in the directory. Once you have r permission on the directory, you can execute the ls command in this directory to view the contents of the directory. Write permission (w) for directories, w permission is the highest permission. Having w permission on the directory means that you can do the following on the directory:

Create a new file or subdirectory in this directory

Delete existing files and directories (regardless of the permissions of subfiles or subdirectories)

Rename an existing file or directory

Move the location of files and directories under this directory.

Once you have w permissions on the directory, you can execute touch, rm, cp, mv, and so on, in the directory. The execute permission (x) directory cannot be run directly, and the directory is given x permission, which means that the user can enter the directory, that is, the user or group that gives x permission can use the cd command.

Description:

For a directory, if only r permission is given, the directory is unusable. Quite simply, for a directory with only r permissions, users can only view the directory structure and cannot enter the directory at all (you need x permission), let alone use it.

Therefore, for directories, there are only three permissions commonly used to set directories: 0 (- -), 5 (rmurx), and 7 (rwx).

The above is the content of this article on "what is the concept of linux executable". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report