Get the App
SLTechnology News&Howtos  ›  Development  › 

How to find executable files in Linux system

Shulou Source: shulou.com Published: 2022-06-01 21:32:32 09月19日 Update

This article analyzes "how to find executable files in Linux system". The content is detailed and easy to understand. Friends who are interested in "how to find executable files in the Linux system" can follow the editor's idea to read it slowly and deeply. I hope it will be helpful to everyone after reading. Let's follow the editor to learn more about "how to find executable files in Linux system".

In the windows system, we can judge whether it is an executable file according to the file suffix format, such as .exe, .bat, etc., but in the Linux system, the format is not judged by the file name suffix, but by the execution permission of the file.

Under Linux, you can't simply judge whether it is executable or not according to the suffix of the file.

The key to judging whether a file is executable under linux depends on whether it has executable permissions, such as:

Enter: ls-l in the terminal and a list similar to the following will be listed:

-rwxrwxr-x 1 bingyue bingyue 48141 Jul 17 02:50 redis-trib.rb*-rw-rw-r- 1 bingyue bingyue 2163 Aug 5 23:34 release.cdrwxrwxr-x 2 bingyue bingyue 4096 Jul 22 20:03 Documents

Taking the following output as an example, the underlined area describes the permissions of the file, including readable, writable, executable, and so on.

[-] [rwx] [rwx] [rMurx] 1 bingyue bingyue 2324109 Aug 5 23:35 redis-cli*

10 characters determine what different users can do to the file: the first character represents the file (-), directory (d), link (l) the rest of the characters every three groups (rwx), read (r), write (w), execute (x), respectively, indicating the permissions of the file owner (User), other users of the user group to which the file owner belongs (Group), and other group users (Others).

The first set of rwx: the permissions of the file owner are to read, write and execute the second set of rwx: the permissions of users in the same group as the file owner are to read, write and execute the third group of Rmurx: the permissions of other users who are not in the same group as the file owner are read and execute, not write

In addition, some files can also be judged by the suffix, for example, in redhat, all the .rpm format can be executed in redhat, and the .deb format in debian can be executed directly in debianlinux.

How to find executable files using ls-F | grep "*"

It can also be used under Ubuntu

Ll | grep "*" ll is not a basic command under linux, but can be thought of as an alias for ls-l.

Ls-F can classify files by type and add symbols such as / * at the end. The-F,-classify append indicator (one of / = > @ |) to entries,-F and-classify options add suffixes to the list view files. Ordinary files do not add suffixes, add numbers to executable files, add / signs to directories, and @ signs to symbolic links. | Pipeline output. Grep "" picks out the lines ending with "" and outputs them.

Similarly, use ls-F | grep "/" to find directories. Use ls-F | grep "@" to find soft connections.

In addition, you can use ls-color to identify the executable:

Instance output:

What are the versions of Linux? the versions of Linux are Deepin, UbuntuKylin, Manjaro, LinuxMint, Ubuntu and so on. Among them, Deepin is one of the best-developed Linux distributions in China; UbuntuKylin is a derivative release based on Ubuntu; Manjaro is a Linux release based on Arch; LinuxMint's default Cinnamon desktop is similar to Windows XP's easy-to-use; Ubuntu is the Linux operating system based on desktop applications.

On the Linux system how to find executable files to share here, I hope that the above content can make you improve. If you want to learn more knowledge, please pay more attention to the editor's updates. Thank you for following the website!

Tags: File system permission suffix user owner format output character version directory release content identity desktop knowledge symbol follow link learn Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn OPPO Reno MySQL Redmi Huawei