From 872e26b524921ec9fd20e164b419f7c17a661438 Mon Sep 17 00:00:00 2001 From: Ryan Blecher Date: Thu, 3 Oct 2019 08:14:59 -0400 Subject: [PATCH 1/2] add documentation for the last command --- docs/commands/last.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 docs/commands/last.md diff --git a/docs/commands/last.md b/docs/commands/last.md new file mode 100644 index 0000000000..2fd9100a78 --- /dev/null +++ b/docs/commands/last.md @@ -0,0 +1,29 @@ +# last + +Use `last` to retrieve the last "n" rows of a table. `last` has a required amount parameter that indicates how many rows you would like returned. If more than one row is returned, an index column will be included showing the row number. `last` does not alter the order the rows of the table. + +## Examples + +```shell +> ps | last 1 +━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━ + pid │ name │ status │ cpu +─────┼─────────────┼─────────┼─────────────────── + 121 │ loginwindow │ Running │ 0.000000000000000 +━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━ +``` + +```shell +> ps | last 5 +━━━┯━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━ + # │ pid │ name │ status │ cpu +───┼─────┼────────────────┼─────────┼─────────────────── + 0 │ 360 │ CommCenter │ Running │ 0.000000000000000 + 1 │ 358 │ distnoted │ Running │ 0.000000000000000 + 2 │ 356 │ UserEventAgent │ Running │ 0.000000000000000 + 3 │ 354 │ cfprefsd │ Running │ 0.000000000000000 + 4 │ 121 │ loginwindow │ Running │ 0.000000000000000 +━━━┷━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━ +``` + + From 9ed889ccbbd39caf30511d8d30fc2b986fa73e1c Mon Sep 17 00:00:00 2001 From: Ryan Blecher Date: Thu, 3 Oct 2019 08:18:51 -0400 Subject: [PATCH 2/2] fix grammar --- docs/commands/last.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/commands/last.md b/docs/commands/last.md index 2fd9100a78..bc7a55f12b 100644 --- a/docs/commands/last.md +++ b/docs/commands/last.md @@ -1,6 +1,6 @@ # last -Use `last` to retrieve the last "n" rows of a table. `last` has a required amount parameter that indicates how many rows you would like returned. If more than one row is returned, an index column will be included showing the row number. `last` does not alter the order the rows of the table. +Use `last` to retrieve the last "n" rows of a table. `last` has a required amount parameter that indicates how many rows you would like returned. If more than one row is returned, an index column will be included showing the row number. `last` does not alter the order of the rows of the table. ## Examples