linux中生成文件的绝对路径

1、测试文件

[root@centos79 test]# touch a.txt b.txt
[root@centos79 test]# ls
a.txt  b.txt

 

2、生成测试文件的绝对路径

[root@centos79 test]# ls
a.txt  b.txt
[root@centos79 test]# ls *.txt | xargs -I {} echo "$PWD/{}"
/home/test/a.txt
/home/test/b.txt

 

posted @ 2021-08-07 11:02  小鲨鱼2018  阅读(275)  评论(0编辑  收藏  举报