path relative-to for path> path relative-to {flags} (path)
path: Parent shared with the input path| input | output | 
|---|---|
| list<string> | list<string> | 
| string | string | 
Find a relative path from two absolute paths
>'/home/viking'|path relative-to'/home'
viking
Find a relative path from absolute paths in list
> [ /home/viking, /home/spam ] |path relative-to'/home'
╭───┬────────╮
│0│viking│
│1│spam│
╰───┴────────╯
Find a relative path from two relative paths
>'eggs/bacon/sausage/spam'|path relative-to'eggs/bacon/sausage'
spam
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.
    Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
    https://www.nushell.sh/commands/docs/path_relative-to.html