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'm new to Linux and Ubuntu. People keep using ~/filename in their answers to my questions. What does ~/ mean?

share|improve this question
add comment

2 Answers 2

up vote 30 down vote accepted

~/ is shorthand for the current user's home folder. So if your user name is "foobar" it expands to /home/foobar/

share|improve this answer
8  
And if you want to refer to another user home directory you can use ~user, as in ls -l ~enzotib/Documents/. –  enzotib Dec 4 '11 at 20:05
2  
Actually, ~ is the shorthand for current user's home folder :) –  heartsmagic Dec 4 '11 at 20:17
    
@heartsmagic True, but ~/ is equally valid. –  WarriorIng64 Dec 4 '11 at 20:40
1  
I did not say invalid :) Generally we see ~ instead of ~/, since / is not necessary there. –  heartsmagic Dec 4 '11 at 20:47
7  
This is only usually correct, but not technically correct. ~ actually expands to the value of the environment variable HOME. If you change the value of HOME, ~ will also no longer point to that user's home directory. –  kojiro Dec 5 '11 at 2:41
show 1 more comment

In general the tilde ~ represents your home folder. Use it to refer to your home directory at the command line.

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.