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

path expand for path

Try to expand a path to its absolute form.

Signature

> path expand {flags}

Flags

  • --strict, -s: Throw an error if the path could not be expanded
  • --no-symlink, -n: Do not resolve symbolic links

Input/output types:

inputoutput
stringstring
list<string>list<string>

Examples

Expand an absolute path

> '/home/joe/foo/../bar' | path expand
/home/joe/bar

Expand a relative path

> 'foo/../bar' | path expand

Expand a list of paths

> [ /foo/../bar, /foo/../baz ] | path expand
╭───┬──────╮
│ 0 │ /bar │
│ 1 │ /baz │
╰───┴──────╯