W3cubDocs

/Nushell

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:

input output
binary binary
list<any> list<any>

Examples

Return the last 2 items of a list/table

> [1,2,3] |last2
╭───┬───╮
02
13
╰───┴───╯

Return the last item of a list/table

> [1,2,3] |last
3

Return the last 2 bytes of a binary value

>0x[012345] |last2
Length:2 (0x2) bytes|printablewhitespaceascii_othernon_ascii
00000000:2345#E

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