tags:

views:

46

answers:

2

In a relative path, what's the difference between ~/directory/subdirectory and ./directory/subdirectory?

+5  A: 

In Linux, ~ is your home directory, while . is the current directory, so those pathes are the same when you are in your home directory (since . is ~), but not in other cases.

~/directory/subdirectory refers to subdirectory folder inside directory folder, inside your home folder.

./directory/subdirectory refers to subdirectory folder inside directory folder, inside current execution folder.

aularon
A: 

~/directory/subdirectory for any particular user, is an absolute path instead. It referes to "directory/subdirectory" inside the user's home directory.

./directory/subdirectory is a relative path. It referes to "directory/subdirectory" inside the current directory (output of pwd command).

Amit