When in Terminal and cd to "Applications" and typing "ls" nothing comes up however when cd to "/Applications" and typing "ls" all the applications come up, would someone be able to explain why the / for only applications makes a difference.

有帮助吗?

解决方案

New shells start in your home directory by default, i.e. /Users/username (~). You then specified a relative path to change directory, Applications, which changed directory to /Users/username/Applications.

This is a different folder to the system-wide applications folder at /Applications. When you cd /Applications, the leading slash provides an absolute path rather than relative path, starting at the top of the volume rather than the current working directory (which is your home folder for new shells).

许可以下: CC-BY-SA归因
不隶属于 apple.stackexchange
scroll top