2020-03-06 17:19:35 +00:00
|
|
|
# cd
|
|
|
|
|
2022-08-15 02:13:29 +01:00
|
|
|
> Display the current working directory or move to a different directory.
|
2023-10-25 06:13:51 +01:00
|
|
|
> In PowerShell, this command is an alias of `Set-Location`. This documentation is based on the Command Prompt (`cmd`) version of `cd`.
|
2022-10-04 16:06:23 +01:00
|
|
|
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/cd>.
|
2020-03-06 17:19:35 +00:00
|
|
|
|
2023-10-25 06:13:51 +01:00
|
|
|
- View documentation of the equivalent PowerShell command:
|
|
|
|
|
|
|
|
`tldr set-location`
|
|
|
|
|
2022-08-15 00:12:35 +01:00
|
|
|
- Display the path of the current directory:
|
2020-03-06 17:19:35 +00:00
|
|
|
|
|
|
|
`cd`
|
|
|
|
|
2023-10-25 06:13:51 +01:00
|
|
|
- Go to a specific directory in the same drive:
|
2022-10-26 16:27:10 +01:00
|
|
|
|
2023-10-25 06:13:51 +01:00
|
|
|
`cd {{path\to\directory}}`
|
|
|
|
|
|
|
|
- Go to a specific directory in a different [d]rive:
|
|
|
|
|
|
|
|
`cd /d {{C}}:{{path\to\directory}}`
|
2022-10-26 16:27:10 +01:00
|
|
|
|
2020-03-06 17:19:35 +00:00
|
|
|
- Go up to the parent of the current directory:
|
|
|
|
|
|
|
|
`cd ..`
|
|
|
|
|
2023-10-25 06:13:51 +01:00
|
|
|
- Go to the home directory of the current user:
|
2022-08-15 00:12:35 +01:00
|
|
|
|
2023-10-25 06:13:51 +01:00
|
|
|
`cd %userprofile%`
|
2022-08-15 00:12:35 +01:00
|
|
|
|
2023-10-25 06:13:51 +01:00
|
|
|
- Go to root of current drive:
|
2020-03-06 17:19:35 +00:00
|
|
|
|
2023-10-25 06:13:51 +01:00
|
|
|
`cd \`
|