W3cubDocs

/Nushell

path type for path

Get the type of the object a path refers to (e.g., file, dir, symlink).

Signature

> path type {flags}

Input/output types:

input output
list<string> list<string>
string string

Examples

Show type of a filepath

>'.'|path type
dir

Show type of a filepaths in a list

>ls|getname|path type

Notes

This checks the file system to confirm the path's object type. If nothing is found, an empty string will be returned.

Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/path_type.html