2016-11-04 9 views
0

私はUbuntuで問題を抱えています。私は/local/jenkins/scriptsのようなディレクトリで作業しています。ここには多くのサブディレクトリがあり、ディレクトリ内にexcute.shファイルをすべて入れたいのですが、 "find -name excute.sh"を使用すると、次のような相対パスのリストが返されます。シェルを使って特定のファイルのフルパスを見つける方法は?

./TEST933/excute.sh 
./TEST923/excute.sh 
./TEST323/excute.sh 
./TEST920/excute.sh 

以下のようにフルパスリストを取得する方法を教えてください。ありがとう!

/local/jenkins/scripts/TEST933/excute.sh 
/local/jenkins/scripts/TEST923/excute.sh 
/local/jenkins/scripts/TEST323/excute.sh 
/local/jenkins/scripts/TEST920/excute.sh 
+0

可能な重複http://stackoverflow.com/questions/246215/how-can-i-list-files-with-their-絶対パスイン・リナックス) –

答えて

1

find -name excute.sh -exec readlink -f {} \; 
[Iは、Linuxでの絶対パスとファイルを一覧表示するにはどうすればよい?](の
1

これは使用できます。

find /local/jenkins/scripts/ -name excute.sh 

例: READLINKと

$ find -name excute.sh 
./TEST920/excute.sh 
./TEST933/excute.sh 
./TEST923/excute.sh 
./TEST323/excute.sh 

$ find /tmp/test/ -name excute.sh 
/tmp/test/TEST920/excute.sh 
/tmp/test/TEST933/excute.sh 
/tmp/test/TEST923/excute.sh 
/tmp/test/TEST323/excute.sh 
関連する問題