nushell/docs/commands/path-parse.md
Fernando Herrera dbcadbc12c moved folders
2022-02-07 19:23:12 +00:00

792 B

path parse

Convert a path into structured data.

Each path is split into a table with 'parent', 'stem' and 'extension' fields. On Windows, an extra 'prefix' column is added.

Usage

> path parse ...args {flags} 

Parameters

  • ...args: Optionally operate by column path

Flags

  • -h, --help: Display this help message
  • -e, --extension : Manually supply the extension (without the dot)

Examples

Parse a path

> echo '/home/viking/spam.txt' | path parse

Replace a complex extension

> echo '/home/viking/spam.tar.gz' | path parse -e tar.gz | update extension { 'txt' }

Ignore the extension

> echo '/etc/conf.d' | path parse -e ''

Parse all paths under the 'name' column

> ls | path parse name