What is the difference between ~ / and ~ in linux?

I am new to Linux using last year. can any buddy help me solve my question? when I use ~/ , only it shows the user's home directory, why it does not work if only ~ to indicate the path to the file or directory.

+5
source share
1 answer

~ means the home directory of the registered user, while ~/ means the path to the beginning of the directory.

From here :

Tilde (~) is a shortcut for Linux to indicate the user's home directory. Thus, the tilde slash (~ /) is the beginning of the file path or directory under the user's home directory.

On a side note If you see ~Gowthaman/ , then this will be the Gowthaman user home directory

+2
source

All Articles