Is there ever a benefit to preceding a path with ./
(dot slash)?
In most cases, cd ./home
is equivalent to cd home
(and also cd ./././././home
). Is there ever a case where these two paths would NOT evaluate to the same path? Is there some benefit or drawback to either having or NOT having ./
at the beginning of a folder or file path?
What if from inside a program or script, I wanted open a config file, i'm hard coding a file to open, should it be:
resource/config.txt
OR
./resource/config.txt
Does POSIX (or common Unix implementations) give any semantic difference between opening these two paths?
./
prefix. Filenames that start with-
is the most obvious case, but there are others. – Wildcard Dec 14 '16 at 21:38