Reputation: 1307
For example, a directory has the following files: (as shown in explorer)
index.php
hello.php
img
If you query it using windows or just type dir in cmd prompt it will have the following files:
.
..
index.php
hello.php
img
I understand that '..' is a link to the previous directory, but what exactly is '.' and how can it be used? I've searched all over the internet, but no avail found for the single dot
Upvotes: 0
Views: 77
Reputation: 6193
In short . is the current directory and .. is the parent directory. It is convenient for you to write scripts with these keyword otherwise you have to write a long command.
Upvotes: 0
Reputation: 41257
The .
can be used in some commands: This will copy the files from c:\temp to the current directory:
copy c:\temp\*.* .
The ..
can be used to move to a higher directory.
This will change to the parent folder:
cd ..
Upvotes: 2
Reputation: 3775
.
is the same as the current directory, but in a relative way.
For instance if the current directory is c:\temp
and if you cd in this directory, then . == c:\temp
.
Upvotes: 0
Reputation: 401
The '.' indicates the current directory as per this. As you mentioned, '..' is a link to the previous directory. Ultimately the Operating System will choose how to indicate these, but it is pretty standard across all major OSs
Upvotes: 1