linux中生成文件的绝对路径

一、测试文件centos

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

 

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

[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
相关文章
相关标签/搜索