Linux Command Classification and priority

Source: Internet
Author: User

I. LIUNX classification
Linux commands can be broadly divided into three types of built-in commands, external commands and alias commands (aliases) (which can be queried by type comment)
1 Built-in commands (BUILTIN), the built-in commands are actually part of the shell program and contain some of the more concise Liunx system commands that are identified by the shell program and run inside the shell program.
Note: This is an internal command for type queries

    查询所有激活的内置命令 enable*   [[email protected] ~]# enable enable .enable :

Enable [
Enable CD
... *
to disable built-in commands, such as enable-n comment ( comment refers to an instruction, the following )

Show all disabled internal commands Enable-n

If you want to re-enable a built-in command that has been banned, enable comment

2 external command , which is a utility part of the Linux system, Because the included program is too large, it will not be loaded into the system memory as soon as it is turned on, but will be transferred into memory when needed. (The shell program manages the path lookup, loading and storage of external commands, and Controls command execution.)
( Note: This is the external command for type query )
The external command is divided into hash cache command and path execution, and all executed commands are called into the cache, and the cache is hash. The hash records the most recent external command that you have executed.
Show all cached command path hash

Empty all cache Hash-r

Execute by Path and can be divided into direct input related path execution and automatic search path execution after input command, directory available for automatic search path Echo¥path view

as shown, search from left to right separated by a colon, and if the same command exists within two folders, the first search command is stored in a hash and executed.
3 alias , alias command refers to the user set command aliases, with shorthand command, improve operational efficiency.
Show all aliases alias

Set an alias alias = ' command-option parameter '

Delete a set alias Unalias alias

Second, priority
If a command is assumed to be present in the built-in command, external command, alias



Direct input comment for testing

You can have the first alias, remove the command from the aliases, and test

The second is a built-in command, disable it and then test


The third is a hash, the cache is deleted after the last Test

It is shown that the priority displayed in the system based on the same command is alias> built-in Commands > External commands (Hash>path)

Linux Command Classification and priority

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.