pavement

Cd

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by Ulizojypawa (Talk) to last revision by Jimbo)
Line 19: Line 19:
 
  [dave]@deus ~ %
 
  [dave]@deus ~ %
  
>==Common Arguments==
+
==Common Arguments==
 
  .. up one level, e.g., cd .. in /e/foo will take you to /e/
 
  .. up one level, e.g., cd .. in /e/foo will take you to /e/
 
  - previous directory
 
  - previous directory
 
  ~ home
 
  ~ home
  ~username home directory of the user "username"
+
  ~username home directory of the user "username"
 
  . the directory I am in. Not used very often with [[cd]] but more often with commands.
 
  . the directory I am in. Not used very often with [[cd]] but more often with commands.
  
 
[[Category:Windows Equivalents]]
 
[[Category:Windows Equivalents]]
 
----
 
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
----
 
=[http://yqeniruk.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=
 
----
 
=[http://yqeniruk.co.cc CLICK HERE]=
 
----
 
</div>
 

Revision as of 21:14, 14 November 2010

The cd command ("Change directory"), sometimes also spelled chdir, is built into any version of the Unix shell that you are likely to find. It is also found in DOS and the Windows CLI (cmd.exe or command.com), where it means the same thing as it does in a shell on FreeBSD and other unixlike OSes.

A notable differences between the Unix shell cd and the DOS version is that, all shell versions of cd require a space between cd and the name of the directory to change to, even if the name is the symbol . (current directory), .. (container directory), or / (file-system root directory).

C:\Windows> cd\stuff (windows)
splat# cd /stuff     (unixlike)
C:\Windows> cd..     (windows)
splat# cd ..         (unixlike)

cd by itself will send you to your home directory, as will cd ~. cd - will show you and then change your directory to the last directory you were in, as below:

[dave]@deus /var/log % cd ~
[dave]@deus ~ % pwd
/home/dave
[dave]@deus ~ % cd /etc
[dave]@deus /etc % cd -
/home/dave
[dave]@deus ~ %

Common Arguments

.. up one level, e.g., cd .. in /e/foo will take you to /e/
- previous directory
~ home
~username home directory of the user "username"
. the directory I am in. Not used very often with cd but more often with commands.
Personal tools