小编Ins*_*tee的帖子

如何在shell中获取父母的父母的目录名称的基名?

我想在shell脚本中掌握当前目录的父目录的父目录的基本名称。

例如:

$ pwd
/home/tmp/terminal/env/1239754/control/state
$
Run Code Online (Sandbox Code Playgroud)

我想要这个- 1239754。

linux bash shell

3
推荐指数
2
解决办法
2387
查看次数

标签 统计

bash ×1

linux ×1

shell ×1