Previous Topic: cat, type Commands--Display Text Files (Cmdlets)Next Topic: copy, cp Commands--Copy Files and Directories (Funclets)


cd, chdir Commands--Change Directory (Cmdlet, Funclet)

These commands change the current directory on the local system. If p is supplied, it defines the new directory. If p is a relative path, the command uses the current path as a prefix for the directory.

The command has the following syntax:

cd [p] (Cmdlet)
chdir [p] (Funclet)
p

(Optional) Defines the directory to change to. The separation character on Windows can be a backslash (\) or a forward slash (/). For UNIX-like systems, it must be a forward slash. For cross-platform script compatibility, only use the forward slash in path specifications.

Default: ""

Examples

Change to root directory:

cd /

Change to directory c:/test

cd c:/test

Change to the parent directory:

cd ..