14

I am novice to Linux, using it a little more than a year. Can anybody help me resolve my question?

When I use ~/ only it shows user home directory. Why does it not work in the case of using ~ alone to specify path to a file or directory?

Catlover
  • 379
  • 2
  • 16

1 Answers1

13

~ means the home directory of the logged on user whereas ~/ means the path to the beginning of a directory.

From here:

The tilde (~) is a Linux "shortcut" to denote a user's home directory. Thus tilde slash (~/) is the beginning of a path to a file or directory below the user's home directory.

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

Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331