- 对与使用绝对路径或相对路径下达的命令例如
/bin/ls
./test
直接在路径中查找 - 在alias中查找
- 在shell的builtin指令中查找
- 在
$PATH
中查找第一个名称匹配额命令
login shell
和 non-login shell
: login shell
值的是通过账号密码输入登录后的shell,non-login shell
指的是没有经过上述登录流程的shell
,例如桌面环境下登录后,打开terminal,或者在login shell
中bash
创建的新shell
/etc/profile
: 系统整体配置~/.bash_profile
或者~/.bash_login
或者~/.profile
: 用户自己的配置,最终都会读取~/.bashrc
读取/etc/profile
的配置时,会获取/etc/profile.d/
下面的脚本文件,并执行
只会读取~/.bashrc
通常bash配置在写入后不会立即更新,只有注销重新登录才会更新,但是可以通过命令直接更新source 配置文件
~/.bash_history
: 记录bash命令记录
~/.bash_logout
: login shell退出是执行的操作,默认只有清除屏幕内容
/etc/man.config
: man的配置文件
stty
: set tty
stty -a
: 列出当前所有配置:
isaac@hp:~/Notes/linux$ stty -a
speed 38400 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
# 省略了部分
inter
: interupt中断当前正在运行的程序
quit
: quit发送quit信号给当前程序
erase
: 删除
kill
: 发送kill信号
eof
: end of input
stop
: 停止当前程序的输出
start
: 恢复被stop暂停的输出
susp
:suspend 暂停当前程序
常用的组合按键:
ctrl + c
: 终止当前进程
ctrl + d
: eof
ctrl + u
: 清空当前输入的命令
ctrl + s
: 暂停当前程序的屏幕输出
ctrl + q
: 恢复当前程序的屏幕输出
ctrl + z
: 暂停当前程序
rc
stands forruncomm
which meansrun command
, butruntime configuration
may be a better explanation