Jon*_*han 7 unix directory csh find absolute-path
我在Unix(csh)上经常使用find命令。
结果是否可能是完整/绝对路径,并且将从我开始搜索的目录开始
例如,从中运行命令时
/project/Test/v0.15/test/frontend,结果为:
./core/serdes_complex/frontend/lib/lib_behave.f
./core/serdes_complex/frontend/lib/test_srd_compile.f
Run Code Online (Sandbox Code Playgroud)
但是我想得到
/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
Run Code Online (Sandbox Code Playgroud)
您应该使用命令realpath来解析路径:
find . -name "*.f" -exec realpath {} \;
Run Code Online (Sandbox Code Playgroud)