Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

get for filters

Extract data using a cell path.

Signature

> get {flags} (cell_path) ...rest

Flags

  • --ignore-errors, -i: ignore missing data (make all cell path members optional)
  • --sensitive, -s: get path in a case sensitive manner

Parameters

  • cell_path: The cell path to the data.
  • ...rest: Additional cell paths.

Input/output types:

inputoutput
list<any>any
nothingnothing
recordany
tableany

Examples

Get an item from a list

> [0 1 2] | get 1
1

Get a column from a table

> [{A: A0}] | get A
╭───┬────╮
│ 0 │ A0 │
╰───┴────╯

Get a cell from a table

> [{A: A0}] | get 0.A
A0

Extract the name of the 3rd record in a list (same as ls | $in.name.2)

> ls | get name.2

Extract the name of the 3rd record in a list

> ls | get 2.name

Getting Path/PATH in a case insensitive way

> $env | get paTH

Getting Path in a case sensitive way, won't work for 'PATH'

> $env | get --sensitive Path

Notes

This is equivalent to using the cell path access syntax: $env.OS is the same as $env | get OS.

If multiple cell paths are given, this will produce a list of values.