3

Mac 终端下获取文件的绝对路径

 2 years ago
source link: https://droidyue.com/blog/2022/02/21/find-file-absolute-path-in-terminal/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

greadlink

greadlink 是一个系统自带的处理文件路径的命令,它的用法如下

greadlink -f file_name
greadlink -f /tmp
/private/tmp

Realpath

realpath 是我比较常用的获取绝对路径的工具,它需要使用homebrew 进行安装后方可使用。

brew install coreutils
realpath double_overflow.apk
/private/tmp/double_overflow.apk

droidyue_gzh_green_png.png

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK