2020-03-06 10:19:35 -07:00
|
|
|
# cd
|
|
|
|
|
2022-08-15 01:13:29 +00:00
|
|
|
> Display the current working directory or move to a different directory.
|
2023-10-25 12:13:51 +07: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 20:36:23 +05:30
|
|
|
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/cd>.
|
2020-03-06 10:19:35 -07:00
|
|
|
|
2023-10-25 12:13:51 +07:00
|
|
|
- View documentation of the equivalent PowerShell command:
|
|
|
|
|
|
|
|
`tldr set-location`
|
|
|
|
|
2022-08-15 09:12:35 +10:00
|
|
|
- Display the path of the current directory:
|
2020-03-06 10:19:35 -07:00
|
|
|
|
|
|
|
`cd`
|
|
|
|
|
2023-10-25 12:13:51 +07:00
|
|
|
- Go to a specific directory in the same drive:
|
2022-10-26 16:27:10 +01:00
|
|
|
|
2023-10-25 12:13:51 +07: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 10:19:35 -07:00
|
|
|
- Go up to the parent of the current directory:
|
|
|
|
|
|
|
|
`cd ..`
|
|
|
|
|
2023-10-25 12:13:51 +07:00
|
|
|
- Go to the home directory of the current user:
|
2022-08-15 09:12:35 +10:00
|
|
|
|
2023-10-25 12:13:51 +07:00
|
|
|
`cd %userprofile%`
|
2022-08-15 09:12:35 +10:00
|
|
|
|
2023-10-25 12:13:51 +07:00
|
|
|
- Go to root of current drive:
|
2020-03-06 10:19:35 -07:00
|
|
|
|
2023-10-25 12:13:51 +07:00
|
|
|
`cd \`
|