0

I get a problem, in my Ubuntu, I work in the directory like /local/jenkins/scripts, there are many sub-directories here, and I want to get all of the excute.sh file in the directories, but you may know, if I use "find -name excute.sh", it will return the list of relative paths, like following.

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

Can you please share how to get the full path list as below? Thanks!

/local/jenkins/scripts/TEST933/excute.sh
/local/jenkins/scripts/TEST923/excute.sh
/local/jenkins/scripts/TEST323/excute.sh
/local/jenkins/scripts/TEST920/excute.sh
Reed_Xia
  • 1,300
  • 3
  • 17
  • 29
  • Possible duplicate of [How can I list files with their absolute path in linux?](http://stackoverflow.com/questions/246215/how-can-i-list-files-with-their-absolute-path-in-linux) – Kir Chou Nov 04 '16 at 08:17

2 Answers2

1

you can use this;

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

eg;

$ 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
Mustafa DOGRU
  • 3,994
  • 1
  • 16
  • 24
1

with readlink ;

find -name excute.sh -exec readlink -f {} \;