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

How to use the builtin command in Linux

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how to use the builtin command in Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The builtin command executes the specified shell internal command and returns the return value of the internal command. When the builtin command is used, you will no longer be able to use external commands in Linux

Builtin executes bash built-in commands.

Summary builtin [shell-builtin [arg...]] The main purpose is to execute specified bash built-in commands.

The bash built-in command called by the builtin command takes precedence over the external command and the shell function with the same name.

Parameter shell-builtin (optional): the bash built-in command to invoke.

Arg (optional): one or more parameters passed to the bash built-in command.

The return value returns the return value executed by the built-in command, unless the built-in command is not passed or the built-in command is disabled.

The priority order of the example with the same name:

Builtin built-in commands > functions > built-in commands > external commands

# for the case where external commands have the highest priority, please refer to the enable command. # at this time, the built-in command gives priority to using echo "the Great Wall" # call the built-in command type, and return the type of command (builtin) type-t echo # define the echo function echo () {printf "123\ n"} # at this time, the function with the same name takes precedence. Display (123) echo # call the built-in command type Returns the type of command (function) type-t echo # at this time, the built-in command gives priority to using builtin echo-e "backslash\" # to execute shell internal instructions Output the command alias builtin alias alias cp='cp-i' alias l.='ls-d. *-- color=tty' alias ll='ls-l-- color=tty' alias ls='ls-- color=tty' alias mv='mv-i' alias rm='rm-i' alias which='alias | / usr/bin/which-- tty-only-- read-alias-- show-dot-- show-tilde' under the current system. Note that this command is a bash built-in command. For related help, please see the help command.

If the built-in command to be invoked is disabled (including builtin), execution will report an error; refer to the enable command for disabling and enabling built-in commands.

The above is all the contents of the article "how to use builtin commands in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to 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

Development

Wechat

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

12
Report