From d3f01ac91c8d96a2badc97a9c84ce564ad1fe615 Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Sat, 15 Apr 2017 00:05:38 +0100 Subject: [PATCH] nl: adjustments per code review --- pages/linux/nl.md | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/pages/linux/nl.md b/pages/linux/nl.md index 860d2f966c..bdea5a255c 100644 --- a/pages/linux/nl.md +++ b/pages/linux/nl.md @@ -4,21 +4,12 @@ - Number lines in a file: -`nl {{source_file}}` +`nl {{file}}` -- Number lines where there is printable text only: +- Number only the lines with printable text: -`nl -t {{source_file}}` +`nl -t {{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}}` +- Number only the body lines that match a basic regular expression (BRE) pattern: +`nl -b p'FooBar[0-9]' {{file}}`