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

687 B

path relative-to

Get a path as relative to another path.

Can be used only when the input and the argument paths are either both absolute or both relative. The argument path needs to be a parent of the input path.

Usage

> path relative-to <path> ...args {flags} 

Parameters

  • <path> Parent shared with the input path
  • ...args: Optionally operate by column path

Flags

  • -h, --help: Display this help message

Examples

Find a relative path from two absolute paths

> '/home/viking' | path relative-to '/home'

Find a relative path from two relative paths

> 'eggs/bacon/sausage/spam' | path relative-to 'eggs/bacon/sausage'