Reed_Xia Reed_Xia - 1 month ago 6
Linux Question

How to find certain file's full path using shell?

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

MTC MTC
Answer

with readlink ;

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