diff options
author | Jim Meyering <jim@meyering.net> | 1999-08-12 15:16:04 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-08-12 15:16:04 +0000 |
commit | 531ced1819ec8f5537d3986d1ad86c96dabcf10f (patch) | |
tree | 34500e8052dc426a8f4d1d2586eb9ea60e8242fd /doc | |
parent | b6ee833da0b67b8074cb258e57f00d1eff0344f3 (diff) | |
download | coreutils-531ced1819ec8f5537d3986d1ad86c96dabcf10f.tar.xz |
Document how to ignore newline during sort
Diffstat (limited to 'doc')
-rw-r--r-- | doc/textutils.texi | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/doc/textutils.texi b/doc/textutils.texi index e4dbcef9a..69636a498 100644 --- a/doc/textutils.texi +++ b/doc/textutils.texi @@ -2347,12 +2347,24 @@ Sort in descending (reverse) numeric order. sort -nr @end example +@item +Ignore trailing newlines when comparing lines, +so that empty lines always sort first. + +@example +# "$newline" is a single newline character. +newline=' +' +sort -t "$newline" -k 1,1 +@end example + +@item Sort alphabetically, omitting the first and second fields. This uses a single key composed of the characters beginning at the start of field three and extending to the end of each line. @example -sort -k3 +sort -k 3 @end example @item @@ -2394,6 +2406,7 @@ sort -t : -n -k 5b,5 -k 3,3 /etc/passwd @item Generate a tags file in case insensitive sorted order. + @example find src -type f -print0 | sort -t / -z -f | xargs -0 etags --append @end example |