Saturday, April 21, 2012

Difference Between cd .. And cd\ Or cd / Command


MS-DOS and Windows command line users:-



When typing the cd.. or cd .. command this moves the directory back one directory also known as theparent directory. As seen in the below example, if you're in the \Windows\System32 directory using the cd.. command takes you back to the Windows directory.

C:\Windows\System32>cd..

C:\Windows>

The cd\ command takes you back to the root directory of the current drive. As can be seen in the below example, if we were in the same \Windows\System32 directory and typed the cd\ command it would take you to the C:\ directory.


C:\Windows\System32>cd\

C:\>



Linux and Unix users:-


When typing the cd .. command (need to have a space between cd and ..) this moves the directory back one directory also known as the parent directory. As seen in the below example, if you're in the /public_html/cgi-bin directory using the cd.. command takes you back to the public_html directory.


 [~/public_html/cgi-bin]# cd ..

 [~/public_html]#


The cd / command takes you back to the root directory of the current drive. As can be seen in the below example, if we were in the same /public_html/cgi-bin directory and typed the cd / command it would take 
you to the / directory.


[~/public_html/cgi-bin]# cd /

[/]#

No comments:

Post a Comment

Please Give Me Your Views

Popular Posts