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

last for filters

Return only the last several rows of the input. Counterpart of `first`. Opposite of `drop`.

Signature

> last {flags} (rows)

Parameters

  • rows: Starting from the back, the number of rows to return.

Input/output types:

inputoutput
binarybinary
list<any>any
rangeany

Examples

Return the last 2 items of a list/table

> [1,2,3] | last 2
╭───┬───╮
│ 0 │ 2 │
│ 1 │ 3 │
╰───┴───╯

Return the last item of a list/table

> [1,2,3] | last
3

Return the last 2 bytes of a binary value

> 0x[01 23 45] | last 2
Length: 2 (0x2) bytes | printable whitespace ascii_other non_ascii
00000000:   23 45                                                #E

Return the last item of a range

> 1..3 | last
3