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
1

2 Answers 2

1

with readlink ;

find -name excute.sh -exec readlink -f {} \;
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

Not the answer you're looking for? Browse other questions tagged or ask your own question.