Find command to return absolute path

I use find command a lot on unix (csh).

Is it possible that the result will be a full / absolute path and start from the directory where I start searching

for example, when running the command from /project/Test/v0.15/test/frontend

, the results are:

./core/serdes_complex/frontend/lib/lib_behave.f
./core/serdes_complex/frontend/lib/test_srd_compile.f

      

But I would like to receive

/project/Test/v0.15/test/frontend/core/serdes_complex/frontend/lib/lib_behave.f
/project/Test/v0.15/test/frontend/core/serdes_complex/frontend/lib/test_srd_compile.f

      

+3


source to share


3 answers


Try searching from $cwd

:



find $cwd -name \*.f

      

+4


source


You should use realpath

to resolve the path:



find . -name "*.f" -exec realpath {} \;

      

+2


source


I got it to work with $PWD

:

find $PWD -name \*.f

+1


source







All Articles