Shell常识
来源:互联网 发布:开淘宝还能赚钱吗 编辑:程序博客网 时间:2024/04/29 13:38
. DOT and Subshell
. (dot) runs a shell script in the current environment and then returns. Normally, the shell runs a command file in a subshell so that changes to the environment by such commands as cd, set, and trap are local to the command file. The . (dot) command circumvents this feature.
A subshell does not inherit the environment variables from parent process.
Fork - system call
fork() creates a new process by duplicating the calling process. The new process, referred to as the child, is an exact duplicate of the calling process. However, child process has its own process id.
&
The Bash & (ampersand) is a builtin control operator used to fork processes. From the Bash man page, "If a command is terminated by the control operator &, the shell executes the command in the background in a subshell".
$BASHPID
Process ID of the current instance of Bash. This is not the same as the $$ variable, but it often gives the same result.
[oracle@odilab ~]$ echo $BASHPID2540
$BASH_VERSION
The version of Bash installed on the system
[oracle@odilab ~]$ echo $BASH_VERSION4.1.2(1)-release
Bash快捷键:
CTRL + R
查找历史命令。输入要查找的命令,ctrl + r 返回最近一个命令。再按ctrl + r 查看其他的。
CTRL + W
输入命令时,删除一个单词
CTRL + U
输入命令时,删除当前整条命令
CTRL + A
光标跑到行首。相当于"Home"键。
cd -
进入上一次的工作目录
- Shell常识
- shell 编程 常识
- shell 脚本编程常识
- shell编程常识
- shell编程常识
- Shell脚本常识
- Shell脚本编程常识
- shell脚本编程常识
- shell常识部分
- shell脚本编程常识
- shell变量小常识
- shell脚本重要的常识
- shell脚本编程的常识
- Shell脚本编程的常识
- Shell脚本编程的常识
- Shell脚本编程的常识
- Shell脚本编程的常识
- Shell 脚本小常识1
- NO3.java学习笔记(顺序结构、判断结构、选择结构、循环结构、函数)
- ElasticSearch的安装和相关插件的安装
- adb server didn't ack 异常解决分享。
- 07 Java反射/动态代理
- Android XML文件读写
- Shell常识
- 人人,金山西山居,腾讯互娱,微信,网易游戏offer及面经
- Android SDK Manager更新不了的解决办法
- 异步消息块
- QT基础
- INADDR_ANY有什么用?
- 并行编程基础之CPU架构理解 SMP/MPP/NUMA/SMT/CMP
- 如何传递函数
- 实现各种制造者-使用者模式