linux 中 dirname和basename

发布时间 2023-09-20 08:34:59作者: 小鲨鱼2018

 

001、

[root@pc1 test2]# ls
[root@pc1 test2]# basename /home/test2/a.txt        ## 仅仅获取文件
a.txt
[root@pc1 test2]# dirname /home/test2/a.txt         ## 仅仅获取路径
/home/test2

 。