linux 中 dirname和basename

 

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

 。

posted @ 2023-09-20 08:30  小鲨鱼2018  阅读(13)  评论(0)    收藏  举报