LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What does . & .. in a directory represent (https://www.linuxquestions.org/questions/linux-newbie-8/what-does-and-in-a-directory-represent-859946/)

Soji Antony 02-01-2011 04:34 AM

What does . & .. in a directory represent
 
Hi

Command ls -a out put shows two hidden directories . and .. I can see the same in all the directories. Plz can anybody tell me what they represent.
Also using cd command i cant enter to these directories....

pwc101 02-01-2011 04:36 AM

. is the directory you are in i.e. the current directory.

.. is the parent directory, so if you're in /home/soji and you do ls .., that will show the contents of /home.

jeethu 02-01-2011 04:36 AM

Any directory/files whose name starts with "." means its a hidden directory/files. I guess these has the informations about the current directory.

jeethu 02-01-2011 04:44 AM

Similar "-" represents the previous directory. So if you do a "cd - " it will jump to the previous directory. Its like a back button in the explorer

Soji Antony 02-01-2011 04:50 AM

Thank you so much ...


All times are GMT -5. The time now is 06:04 AM.