Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

cd for filesystem

Change directory.

Signature

> cd {flags} (path)

Flags

  • --physical, -P: use the physical directory structure; resolve symbolic links before processing instances of ..

Parameters

  • path: The path to change to.

Input/output types:

inputoutput
nothingnothing

Examples

Change to your home directory

> cd ~

Change to the previous working directory (same as "cd $env.OLDPWD")

> cd -

Changing directory with a custom command requires 'def --env'

> def --env gohome [] { cd ~ }

Move two directories up in the tree (the parent directory's parent). Additional dots can be added for additional levels.

> cd ...

The cd command itself is often optional. Simply entering a path to a directory will cd to it.

> /home