linux 查看自己bash shell所处的层级!!!
还是记一下笔记,第一个是网上抄的,第二个是看书学习的,记录下来,就不会忘记了。
echo $SHLVL
ps --forest
(base) [sidian@VM_0_17_centos ~]$ echo $SHLVL
3
(base) [sidian@VM_0_17_centos ~]$ ps --forest
PID TTY TIME CMD
21063 pts/0 00:00:00 bash
21210 pts/0 00:00:00 \_ bash
21270 pts/0 00:00:00 \_ bash
21377 pts/0 00:00:00 \_ ps
(base) [sidian@VM_0_17_centos ~]$