Frolo321
Frolo321

Reputation: 19

What does "./" do in href?

I know that for example:

../path/to/file.html

does first jump from the current directory to the next higher directory and then enters path/to/file.html

However what does

   ./path/to/file.html

do? I couldn't find an answer on the net so far :(

Upvotes: 0

Views: 66

Answers (2)

josemartindev
josemartindev

Reputation: 1426

./ or . is ALWAYS the current directory.

~/(on Linux) is the current user's home directory. For you to know as well: cd %userprofile% (on Windows) sends you to home user directory

Imagine I you're in repository2 and you want to include the file.txt:

~/ ---> Pictures
   ---> Documents  --> repository1 --> repository2 
   ---> Downloads
   ---> file.txt

You simply do:

../../file.txt

or

~/file.txt

And Imagine you want to move the file.txt to the current repository:

mv ../../file.txt .

Upvotes: 2

Jordi Nebot
Jordi Nebot

Reputation: 3401

. is a reference to the current directory. See: Path (computing)

Upvotes: 0

Related Questions