Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using OSX Lion and every time I tried to cd to my Desktop folder using "cd ~" and cd "Desktop" it stays in my home directory instead of going to Desktop. I've tried to perform the commands using sudo but it makes no difference.

Thanks.

share|improve this question
    
If you type pwd and press Enter, what is the output? (Star out username if you want) –  Canadian Luke Feb 11 '12 at 17:44
    
What's the output of ls? –  Daniel Beck Feb 11 '12 at 17:44
    
Does cd ~/Documents work ? –  Karolos Feb 11 '12 at 17:51
    
After doing pwd I realized I was in another user's home folder. That's why I couldn't access the home folder. But I am the administrator, why can't I access the other standard user's folder, even with sudo? It looks like their Public folder is the only one I could access. –  superuser Feb 11 '12 at 17:52
1  
@David: Using sudo doesn't mean you own the files from other users. Permissions still apply. –  Karolos Feb 11 '12 at 17:53
show 2 more comments

1 Answer

up vote 3 down vote accepted

Using the sudo command will grant access to any folder or file on the Mac.

The commands sudo cd ~ return and sudo cd Desktop return only appeared to fail. In fact, both commands succeeded but exited without any output.

To demonstrate this try the command sudo -i "cd ~;pwd"return which should print /var/root in the terminal window.

In order to use the same commands interactively, do following:

  1. sudo -i return
  2. cd ~ return
  3. pwd return

Output

/var/root

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.