解决MacOS下readlink: illegal option -- f

文章转自:https://blog.bbzhh.com/index.php/archives/141.html
版权归原作者!


Mac下的readlink没有-f参数,诸如screenfetch又会去调用readlink -f,于是每次都会出现:

readlink: illegal option -- f
usage: readlink [-n] [file ...]

很是烦人,解决方案如下:
1.安装coreutils:

brew install coreutils

2.设置环境变量,编辑~/.bash_profile,添加:

export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"

3.创建别名,使用greadlink替代readlink,同样是编辑~/.bash_profile,添加:

alias readlink=greadlink

你可能感兴趣的:(Mac,tool,use)