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 join for path

Join a structured path or a list of path parts.

Signature

> path join {flags} ...rest

Parameters

  • ...rest: Path to append to the input.

Input/output types:

inputoutput
list<string>string
recordstring
stringstring
tablelist<string>

Examples

Append a filename to a path

> '/home/viking' | path join spam.txt
/home/viking/spam.txt

Append a filename to a path

> '/home/viking' | path join spams this_spam.txt
/home/viking/spams/this_spam.txt

Use relative paths, e.g. '..' will go up one directory

> '/home/viking' | path join .. folder
/home/viking/../folder

Use absolute paths, e.g. '/' will bring you to the top level directory

> '/home/viking' | path join / folder
/folder

Join a list of parts into a path

> [ '/' 'home' 'viking' 'spam.txt' ] | path join
/home/viking/spam.txt

Join a structured path into a path

> { parent: '/home/viking', stem: 'spam', extension: 'txt' } | path join
/home/viking/spam.txt

Join a table of structured paths into a list of paths

> [[ parent stem extension ]; [ '/home/viking' 'spam' 'txt' ]] | path join
╭───┬───────────────────────╮
│ 0 │ /home/viking/spam.txt │
╰───┴───────────────────────╯

Notes

Optionally, append an additional path to the result. It is designed to accept the output of 'path parse' and 'path split' subcommands.