1.什么是build in命令:
shell内建命令是指bash(或其它版本)工具集中的命令。一般都会有一个与之同名的系统命令,比如bash中的echo命令与/bin/echo是两个不同的命令,尽管他们行为大体相仿。当在bash中键入一个命令时系统会先看他是否是一个内建命令,如果不是才会查看是否是系统命令或第三方工具。所以在bash中键入echo命令实际上执行bash工具集中的bash命令也就是内建命令,而不是/bin/echo这个系统命令。
2.内建命令与系统命令
内建命令要比系统论命令有比较高的执行效率。外部命令执行时往往需要fork出(产生出)一个子进程,而内建命令一般不用。下面(或许以后还会有)这一篇文章将介简bash的内建命令。
3.查看一个命令是系统命令还是内建命令:type
linuxidc@www.linuxidc.com:~/Documents
$ type -a pwd
pwd is a shell builtin
pwd is /bin/pwd
[root@linuxidc ~]# type -a echo
echo is a shell builtin
echo is /bin/echo
可以看出,有些命令,echo和pwd同时是内建命令和系统命令。
4.常见命令的类型
[root@linuxidc ~]# type -a cd
cd is a shell builtin
[root@linuxidc ~]# type -a pwd
pwd is a shell builtin
pwd is /bin/pwd
[root@linuxidc ~]# type -a time
time is a shell keyword
time is /usr/bin/time
[root@linuxidc ~]# type -a date
date is /bin/date
[root@linuxidc ~]# type -a which
which is aliased to `alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
which is /usr/bin/which
[root@linuxidc ~]# type -a whereis
whereis is /usr/bin/whereis
[root@linuxidc ~]# type -a whatis
whatis is /usr/bin/whatis
[root@linuxidc ~]# type -a function
function is a shell keyword
[root@linuxidc ~]# type -a ls
ls is aliased to `ls --color=tty'
ls is /bin/ls
[root@linuxidc ~]# type -a ll
ll is aliased to `ls -l --color=tty'
[root@linuxidc ~]# type -a echo
echo is a shell builtin
echo is /bin/echo
[root@linuxidc ~]# type -a bulitin
-bash: type: bulitin: not found
[root@linuxidc ~]# type -a builtin
builtin is a shell builtin
[root@linuxidc ~]# type -a keyword
-bash: type: keyword: not found
[root@linuxidc ~]# type -a command
command is a shell builtin
[root@linuxidc ~]# type -a alias
alias is a shell builtin
[root@linuxidc ~]# type -a grep
grep is /bin/grep
相关推荐
Pro Bash Programming teaches you how to effectively utilize the Bash shell in your programming. The Bash shell is a complete programming language, not merely a glue to combine external Linux commands....
Shell Programming in Unix, Linux and OS X is a thoroughly updated revision of Kochan and Wood’s classic Unix Shell Programming tutorial. Following the methodology of the original text, the book ...
The bash shell is a complete programming language, not merely a glue to combine external Linux commands. By taking full advantage of shell internals, shell programs can perform as snappily as ...
The bash shell is a complete programming language, not merely a glue to combine external Linux commands. By taking full advantage of shell internals, shell programs can perform as snappily as ...
Learning Linux Shell Scripting covers Bash, GNU Bourne Again Shell, preparing you to work in the exciting world of Linux shell scripting. CentOS is a popular rpm-based stable and secured Linux ...
docker build --rm -t thelebster/mongo-shell-example .docker run -ti --rm --name mongo-shell-example -d thelebster/mongo-shell-exampledocker exec -it mongo-shell-example bashdocker run -ti --rm --name...
Learn about scripting in Perl and programming in Python as a BASH scripting alternative with this practical, step-by-step guide Book Description Shell scripting is a quick method to prototype a ...
Covering Bash, Bourne, and Korn shell scripting, this updated edition provides complete shell scripts plus detailed descriptions of each part. UNIX programmers and system administrators can tailor ...
Bash, Bourne, and Korn Shell Scripting for Programmers, System Administrators, and UNIX GurusUNIX expert Randal K. Michael guides you through every detail of writing shell scripts to automate specific...
Mastering Unix Shell Scripting: Bash, Bourne, and Korn Shell Scripting for Programmers, System Administrators, and UNIX Gurus /by Randal K. Michael. UNIX expert Randal K. Michael guides you through ...
Build options into the shell script to give the end user more flexibility on the command line Replicate data using rsync Create snapshot-style backups using Dirvish Work with records files to parse...
通过使用本机二进制文件而不是Shell脚本,可以缩短执行时间。 防止混淆代码,以防止修改。 bash2cpp并不是一个完整的翻译器,但是对于简单的脚本却表现出色。 要求 sudo apt-get install -y build-essential sudo...
Ron Peters, “Expert Shell Scripting” Apress | 2009-01-06 | ...Ignore Python, and script in bash and ksh instead. Who is this book for? System administrators who need solutions to everyday problems.
2020年项目状态:BashSupport已停用。 请参阅和以了解原因。 该存储库已存档。 2018年项目状态:BashSupport项目将仅收到针对主要问题的修复程序自2009... 构建定义在build.gradle ,它使用ant文件build.xml重新生成Ba
bash 构建器 用 Bash 脚本编写的简单 JS 和 SCSS 构建器。 该工具处于非常早期的开发阶段。 目前不建议将此工具用于教育目的以外的用途。 为什么不直接使用 Gulp.js 或任何其他同类产品? 主要是因为性能。 我自己...
该项目使用机制在bash shell上为R提供了特定于上下文的命令行完成的实现。 它提供了一个文件,该文件应在系统bash完成加载后执行,通常是将其放置在/usr/share/bash-completion/completions/或/etc/bash_completion....
银翼杀手 Bladerunner是一个程序,用于从任何类型的启用ssh的基于文本的设备发送和接收信息。...安装通过通常的方法完成安装:$ python setup.py build$ sudo python setup.py install 或者,您可以通
build_scripts 这是一组有效执行的脚本: wget foo unzip foo cd foo ./configure --prefix=${HOME}/local make make install 这通常足以在没有root许可的情况下在系统上安装最新版本的软件。
存档并导出到IPA 生成安装链接HTML 通过sshpass将所有对象上传到远程服务器通过电报机器人通知包括演示以及完整的C#和BASH源代码如何使用在SupportFiles/build.sh和清单中编辑参数运行build.sh 泡杯茶演示版在终端...