Question

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.

Was it helpful?

Solution

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).

Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange
scroll top