~/ refers to the absolute path of your home directory a.k.a.
Additionally, if you try
cd ~ or
cd ~/ they will both do the same thing; the shortest option being simply
cd. All three options take you to your home directory. NOT /home.
.bashrc is located in your home directory, you must specify its location by adding the tilde, which allows you to point to home directory from wherever you are and thus access the
Of course, this works for any other files and folders located in your
~, for example:
What you were trying to do is open
.bashrc, but since vim checks in your current location if the file already exists or not, it will create a new .bashrc file in your current
pwd, since there is no current .bashrc where you were trying to open it.
In other words, if you were in
/home/username/someFolder/someSubFolder, doing the
vim .bashrc command will create a new
.bashrc file, since there is no already existing
.bashrc and you did not point to the right path, which is