From e608317d3c67a068f499030953993bcd5fb4488a Mon Sep 17 00:00:00 2001 From: Larry850806 Date: Wed, 30 Mar 2016 23:13:36 +0800 Subject: [PATCH] Update sort.md --- pages/common/sort.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pages/common/sort.md b/pages/common/sort.md index 7b29ccde4..01e110bba 100644 --- a/pages/common/sort.md +++ b/pages/common/sort.md @@ -13,3 +13,11 @@ - Sort passwd file by the 3rd field: `sort -t: -k 3n /etc/passwd` + +- Sort a file as number in ascending order: + +`sort -n {{filename}}` + +- Sort a file preserving only unique lines: + +`sort -u {{filename}}`