Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've been told to go to ~/.ssh and, actually, I did cd ~/.ssh and I got into it.

However, I'm wondering: what does the ~ mean in this context?

share|improve this question
    
also most of the time if you do just "cd" you will land there (~). –  jokoon Mar 28 '11 at 14:24

3 Answers 3

up vote 25 down vote accepted

~ = $HOME = your home directory

The next commands will change to your home directory /home/david if your username is david:

cd
cd ~
cd $HOME
cd /home/david
cd ~david
share|improve this answer
    
Nice. :) Thanks. :) –  MEM Mar 28 '11 at 10:42
5  
"change your home directory" -> "make the home directory the present work directory" –  steabert Mar 28 '11 at 12:47
    
also, typing cd will get you into your homefolder. –  Bart De Vos Mar 28 '11 at 16:14

You can also use ~username (no slash) to have it lookup the home directory of a user; that is, ~khamer resolves to /home/khamer, whereas ~david would resolve to /home/david regardless of who is typing the command.

share|improve this answer

If you type:

cd ~/

and hit TAB, the command should change to the actual path to your home folder. As far as I know, this works with pretty much any command that takes a path as an argument.

share|improve this answer

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.