I just found a workaround for a problem I was having with the subl
command for Sublime Text 3 when the MacPorts version of python is installed. The instructions say to put a soft link, ln-s
to the command line app in your /bin. That didn't work, so I just opened my ~/.profile and added an alias:
alias subl="/Applications/path/to/subl"
.
But that begs a new question for me. What is the difference between these two: alias and soft links?
相关问题
- How to get the return code of a shell script in lu
- JQ: Select when attribute value exists in a bash a
- Invoking Mirth Connect CLI with Powershell script
- Xcode debugger displays incorrect values for varia
- Is there a way to report errors in Apple documenta
相关文章
- 使用2台跳板机的情况下如何使用scp传文件
- 现在使用swift开发ios应用好还是swift?
- Visual Studio Code, MAC OS X, OmniSharp server is
- In IntelliJ IDEA, how can I create a key binding t
- Check if directory exists on remote machine with s
- shell中反引号 `` 赋值变量问题
- How get the time in milliseconds in FreeBSD?
- xcode 4 garbage collection removed?
They're entirely different things, though in this case they can be used for similar purposes.
This:
creates an alias, so that typing
subl
as a shell command is equivalent to typing/Applications/path/to/subl
.In bash, functions are generally preferred to aliases, because they're much more flexible and powerful.
Both these things are specific to the shell; they cause the shell to expand
sub1
to a specified command.ln -s
, on the other hand, creates a symbolic link in the file system. A symbolic link is a reference to another file, and for most purposes it can be treated as if it were the file itself. It applies to anything that accesses it, not just to the shell, it's immediately visible to all processes running on the system, and it persists until it's removed. (A symbolic link is implemented as a small special file containing the name of the target file.)