nushell/docs/commands/path-parse.md
JT bff81f24aa
Autogenerate missing docs (#3514)
* Autogenerate missing docs

* Update ansi.md

* Rename question mark command docs

* Delete empty?.md
2021-05-30 12:57:04 +12: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