如何在bash脚本中获取当前工作目录名称,甚至更好,只需一个终端命令.
pwd给出了当前工作目录的完整路径,例如/opt/local/bin但我只想要bin
pwd
/opt/local/bin
bin
bash shell
bash ×1
shell ×1