in macosx error readlink greadlink ~ read.

Fixing "readlink: illegal option -- f" error on a Mac

So, if you are a happy Mac user and facing problem with "readlink: illegal option -- f", then i have a simple solution for you :

  1. Install brew if you still don't have it.
  2. Run brew install coreutils
  3. Instead of readlink use now greadlink
greadlink --help  
Usage: greadlink [OPTION]... FILE...  
Print value of a symbolic link or canonical file name

  -f, --canonicalize            canonicalize by following every symlink in
                                every component of the given name recursively;
                                all but the last component must exist
  -e, --canonicalize-existing   canonicalize by following every symlink in
                                every component of the given name recursively,
                                all components must exist
  -m, --canonicalize-missing    canonicalize by following every symlink in
                                every component of the given name recursively,
                                without requirements on components existence
  -n, --no-newline              do not output the trailing delimiter
  -q, --quiet,
  -s, --silent                  suppress most error messages
  -v, --verbose                 report error messages
  -z, --zero                    end each output line with NUL, not newline
      --help     display this help and exit
      --version  output version information and exit

GNU coreutils online help: <http://www.gnu.org/software/coreutils/>  
Report greadlink translation bugs to <http://translationproject.org/team/>  
For complete documentation, run: info coreutils 'greadlink invocation'  
comments powered by Disqus
comments powered by Disqus