<linux built-in commands and external commands >

Source: Internet
Author: User
Tags builtin

Built-in commands and external commands under Linux

1, the Linux command can be divided into internal commands and external commands:

Internal commands are transferred into memory when the system starts, and are resident in memory, so the execution efficiency is high.

The external command is the software function of the system, and the user is required to read the memory from the hard disk.

Enable allows you to view internal commands as well as to determine whether they are internal.

[[email protected] ~]# enable ls  //determine if LS is a built-in command
/span>-bash:enable:ls:not a shell builtin//It is not an internal command
[[email protected] ~]# enable PWD//pwd for internal Commands
[[email  ;p rotected] ~]# enable-n//Turn off use pwd internal command-n

[Email protected] ~]# enable-a| grep pwd//check to see if close
Enable-n pwd
[[email protected] ~]# enable PWD//turn on using PWD built-in commands
[Email protected] ~]# enable-a| grep pwd
Enable PWD

Internal command user input the rate of system calls is fast, not the built-in command, the system will read the environment variable file. bash_profile,/etc/profile to find the path.

Then in the case of a call to the command, some historical commands are used later, it will exist in the hash table, and when you re-enter the command its call will be such a process.

Hash--> the call to the built-in command-->path command should actually be such a process.

[Email protected] ~]# pwd
/root
[[email protected] ~]# ls
Anaconda-ks.cfg Install.log Install.log.syslog
[[email protected] ~]# hash-l//Display hash table
Builtin Hash-p/bin/cat Cat
Builtin hash-p/bin/ls ls

It can be seen from the hash table. The hash table does not hold the system built-in commands.

<linux built-in commands and external commands >

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.