From a8cc78e6b1fd4fda40d0d26129f5cbf56c0eb0d4 Mon Sep 17 00:00:00 2001 From: Jason Yu Date: Thu, 25 Jan 2018 10:11:05 +0000 Subject: [PATCH] nl: added read from stdout and number blank lines. (#1903) --- pages/linux/nl.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pages/linux/nl.md b/pages/linux/nl.md index bdea5a255c..761ffc1f06 100644 --- a/pages/linux/nl.md +++ b/pages/linux/nl.md @@ -2,14 +2,22 @@ > A utility for numbering lines, either from a file, or from standard input. -- Number lines in a file: +- Number non-blank lines in a file: `nl {{file}}` +- Read from standard output: + +`cat {{file}} | nl {{options}} -` + - Number only the lines with printable text: `nl -t {{file}}` +- Number all lines including blank lines: + +`nl -b a {{file}}` + - Number only the body lines that match a basic regular expression (BRE) pattern: `nl -b p'FooBar[0-9]' {{file}}`