Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Another way to get to your home directory UNIX
I don't know why but the tilde shortcut "~" to access my User Folder doesn't work for me (I get a "Permission Denied" alert). I've just discovered that "cd home" does exactly the same: it moves you to the user directory...I don't know if it's a common Unix feature or another alias made by Apple but it's neat!

descoff.
    •    
  • Currently 2.33 / 5
  You rated: 2 / 5 (3 votes cast)
 
[2,921 views]  

Another way to get to your home directory | 3 comments | Create New Account
Click here to return to the 'Another way to get to your home directory' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
huh
Authored by: Hes Nikke on May 21, '01 01:22:15AM

% cd ~
works for me
do soes % cd
i think that's the easist!



[ Reply to This | # ]
~ is not an alias!
Authored by: owain_vaughan on May 21, '01 04:32:20AM

The reason you are getting permission denied errors is because you are typing '~' as a command, when in fact it is a pseudo path. What you want to type is 'cd ~'. 'cd home' is in fact specific to the C-shell (and tcsh).

So we have:
% cd
% cd ~
% cd ~user
% cd home
% cd $HOME
% cd /Users/$USER

So as you can see just typing 'cd' is by far the easist.



[ Reply to This | # ]
~ is not an alias!
Authored by: babbage on May 21, '01 02:51:58PM

Seems to me that the best habit is "cd ~" though. It's still pretty short (I'm not
gonna complain about going from 2 to 4 characters) and it can be the basis of a lot
of other shortcuts: "cd ~/bin", "(cd ~/Applications/setiathome/ ; ./setiathome) &",
"vi ~/Library/Preferences/com.apple.Terminal.plist", "ls ~/Documents", etc. Having
the tilde in there by habit makes things pretty easy to remember.



[ Reply to This | # ]