when we specify the file path some times we specify like ./filename and some time ../filename what is difference between these two?

link|improve this question
feedback

migrated from stackoverflow.com Aug 4 '10 at 12:30

This question came from our site for professional and enthusiast programmers.

4 Answers

../ refers to the parent folder while ./ means the current folder

link|improve this answer
they are just a shortcut, so you dont have to write out long directory names. – Keltari Aug 25 '11 at 2:41
feedback

. means 'the current folder'.
.. means 'the folder containing the current folder'.

link|improve this answer
feedback

just in case you wonder, ./filename actually means the same thing as filename - however, on unix systems, the current path isn't searched for executables (for security reasons), so you have to explicitly say "look in the current directory"

link|improve this answer
feedback

Both are different. ./filename points to a file in current directory while ../filename points to a file in parent directory

link|improve this answer
feedback

Your Answer

 
or
required, but never shown