# 获取文件绝对路径 readlink -f file.txt # 获取文件父目录绝对路径 dirname $(readlink -f file.txt) # 使用find显示文件的绝对路径 find "$(cd ..; pwd)" -name "filename"