PowerShell: Navigate Directory

By Xah Lee. Date: . Last updated: .

Here's commands to navigate directory.

change dir

cd (alias of Set-Location)

Change dir.

# go up one dir
cd ..

# go to home dir

show current dir path

pwd (alias of Get-Location)

Show current dir path.

list dir content

dir (alias of Get-ChildItem)

List dir content.

go to previous dir

popd (alias of Pop-Location)

Go to a dir last pushed by pushd.

pushd (alias of Push-Location)

Push current dir path to a stack. Can go back to it by popd.

open a file

ii (alias of Invoke-Item)

open item with default app.

# open the current dir in file explorer
ii .

PowerShell, Working with Directory

PowerShell, List Files