From 60ebf37f351be4964e781fe9d2607fafbf84ac42 Mon Sep 17 00:00:00 2001 From: PFCKrutonium Date: Wed, 30 Nov 2016 16:54:59 -0500 Subject: [PATCH] nl: add page (fixes #1163) --- pages/linux/nl.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 pages/linux/nl.md diff --git a/pages/linux/nl.md b/pages/linux/nl.md new file mode 100644 index 000000000..860d2f966 --- /dev/null +++ b/pages/linux/nl.md @@ -0,0 +1,24 @@ +# nl + +> A utility for numbering lines, either from a file, or from standard input. + +- Number lines in a file: + +`nl {{source_file}}` + +- Number lines where there is printable text only: + +`nl -t {{source_file}}` + +- Number lines that match a regular expression (Starting with a Capital +A is Exampled): + +`nl -b p^A {{source_file}}` + +- Can be useful as an alternative to grep {{source_file}} -n +{{search_term}}: + +`nl ./file | grep match` + +Which outputs `{{line_number}} {{search_term}}` +