Using the sudo command will grant access to any folder or file on the Mac.
The commands return and sudo cd ~ return only appeared to fail. In fact, both commands succeeded but exited without any output. sudo cd Desktop
To demonstrate this try the command return which should print sudo -i "cd ~;pwd" in the terminal window./var/root
In order to use the same commands interactively, do following:
sudo -i returncd ~ returnpwd returnOutput
/var/root
There is. Type:
cd sample_dir
It checks for you. If for some strange reason that doesn't work, type:
cd ./sample_dir