andrewsomething Asked: 2011-12-05 11:47:27 +0800 CST2011-12-05 11:47:27 +0800 CST 2011-12-05 11:47:27 +0800 CST What does `~/ ` mean? 772 I'm new to Linux and Ubuntu. People keep using ~/filename in their answers to my questions. What does ~/ mean? command-line 3 Answers Voted Best Answer andrewsomething 2011-12-05T11:48:34+08:002011-12-05T11:48:34+08:00 ~/ is shorthand for the current user's home folder. So if your user name is "foobar" it expands to /home/foobar/ Lucas Amorim Silva 2016-01-04T06:53:04+08:002016-01-04T06:53:04+08:00 An important thing is, if you are using the root user, ~/ will be the /root directory, not /home/user_name. In this case, do: > cd ~/ ; pwd ; It will exit: > /root haziz 2011-12-19T01:23:59+08:002011-12-19T01:23:59+08:00 In general the tilde ~ represents your home folder. Use it to refer to your home directory at the command line.
~/
is shorthand for the current user's home folder. So if your user name is "foobar" it expands to/home/foobar/
An important thing is, if you are using the root user,
~/
will be the/root
directory, not/home/user_name
.In this case, do:
It will exit:
In general the tilde ~ represents your home folder. Use it to refer to your home directory at the command line.