Listing Frameworks folder on Mac gives different results due to EWSMac.framework

I can't understand what is happening. I am using macOS 10.14.6. I am simply trying to find R.framework which is inside Library/Frameworks folder I get EWSMac.framework (I don't know what is this):

MBP:~ me$ cd Library/Frameworks
MBP:Frameworks sergiobacelar$ ls
EWSMac.framework

But when I do:

MBP:~ me$ cd /Library/Frameworks/R.framework/Resources
MBP:Resources me$ cd ..
MBP:R.framework me$ cd ..
MBP:Frameworks me$ ls
AEProfiling.framework       PROJ.framework
AERegistration.framework    PluginManager.framework

I get the usual list of frameworks.


Solution 1:

The / matters

This is the Unix file system and use of relative and absolute paths .

All Unix files and directories are in one space all under the root directory /

An absolute path is one beginning with / and is always seen the same.

If the path does not beginning with / it is a relative path and if used it is appened to your current working directory.

So in the first case you are in your home directory which the shell shows as ~. The shell expands ~ to the absolute path of your home diurectory which is usually /Users/me if your user name is me. You then cd to a directory that adds the parameter you pass to cd to the current directory e.g. you cd to /Users/me/Library/Frameworks which contains frameworks just for your user which in this case is EWSMac.

To see this after you cd in both cases enter the command pwd to show what directory you are in.