简体   繁体   中英

Command not found after creating symbolic link OSX

I've created a symbolic link: sudo ln -s ../../Applications/MAMP/htdocs/project/tools.sh /usr/local/bin/n . The symbolic link is added to the system: lrwxr-xr-x 1 root admin 57B Jul 27 09:05 n -> ../../Applications/MAMP/htdocs/project/tools.sh . But when I type "n" inside my terminal it says: command not found: n . What I'm doing wrong?

A relative link would be useful only from a given directory, and then only if the current directory . (referred to as dot ) were in your PATH variable. Unless your shell initialization set that explicitly, on OSX you won't have dot in PATH .

The dot may be explicit:

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:.

or implicit. For example, if PATH were one of the following, it would implicitly use dot :

:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:
/usr/local/bin:/usr/bin:/bin::/usr/sbin:/sbin

Further reading: the discussion of PATH in POSIX 8.3 Other Environment Variables .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM