What is the built-in (buildin) command of bashshell?

Source: Internet
Author: User
Tags builtin
What is the built-in (buildin) command of bashshell 1. what is the buildin command: the built-in shell command refers to the commands in the bash (or other version) tool set. Generally, there is a system command with the same name. for example, the echo command in bash is different from/bin/echo... what is the bash shell built-in (build in) Command 1. what is the build in command: the shell built-in command refers to the command in the bash (or other version) tool set. Generally, there is a system command with the same name. for example, the echo command in bash and/bin/echo are two different commands, although they are similar in behavior. When you type a command in bash, the system first checks whether it is a built-in command. if not, it checks whether it is a system command or a third-party tool. Therefore, in bash, type the echo command to execute the bash command in the bash tool set, that is, the built-in command, instead of the/bin/echo system command. 2. the built-in commands and system commands have higher execution efficiency than the system commands. When executing external commands, you often need to fork out (generate) a sub-process, while built-in commands are generally not used. The following (or later) article describes the built-in bash commands. 3. check whether a command is a system command or a built-in command: typehyk @ hyk-linux :~ /Documents $ type-a pwdpwd is a shell builtinpwd is/bin/pwd hyk @ hyk-linux :~ /Documents $ type-a echoecho is a shell builtinecho is/bin/echo. some commands, echo and pwd are both built-in commands and system commands. 4. common command types [root @ new55 ~] # Type-a cd is a shell builtin [root @ new55 ~] # Type-a pwd is a shell builtinpwd is/bin/pwd [root @ new55 ~] # Type-a time is a shell keywordtime is/usr/bin/time [root @ new55 ~] # Type-a date is/bin/date [root @ new55 ~] # Type-a which is aliased to 'Alias |/usr/bin/which -- tty-only -- read-alias -- show-dot -- show-tilde 'which is/usr/ bin/which [root @ new55 ~] # Type-a whereis is/usr/bin/whereis [root @ new55 ~] # Type-a whatis/usr/bin/whatis [root @ new55 ~] # Type-a function is a shell keyword [root @ new55 ~] # Type-a ls is aliased to 'ls -- color = tty 'ls is/bin/ls [root @ new55 ~] # Type-a ll is aliased to 'ls-l -- color = tty '[root @ new55 ~] # Type-a echo is a shell builtinecho is/bin/echo [root @ new55 ~] # Type-a bulitin-bash: type: bulitin: not found [root @ new55 ~] # Type-a builtin is a shell builtin [root @ new55 ~] # Type-a keyword-bash: type: keyword: not found [root @ new55 ~] # Type-a command is a shell builtin [root @ new55 ~] # Type-a alias is a shell builtin [root @ new55 ~] # Type-a grep is/bin/grep [root @ new55 ~] #
Related Article

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.