A bunch of new pages:
common/: dig, gzip, rm, sort, zfs, zpool
linux/: apt-get, shutdown
osx/: airport, caffeinate, diskutil, networksetup open, pgrep, qlmanage, say, shutdown, sysctl, system_profiler
Edits to existing pages:
curl: Added simple download example
find: Added iname and size exmaples
grep: Edited -c description
ps: Added wide lines example
ssh: edited -D description, added simple port forwarding example
unzip: added list option
2014-02-10 20:36:05 +00:00
|
|
|
# sort
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Sort lines of text files.
|
2020-09-09 11:33:24 +01:00
|
|
|
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/sort-invocation.html>.
|
A bunch of new pages:
common/: dig, gzip, rm, sort, zfs, zpool
linux/: apt-get, shutdown
osx/: airport, caffeinate, diskutil, networksetup open, pgrep, qlmanage, say, shutdown, sysctl, system_profiler
Edits to existing pages:
curl: Added simple download example
find: Added iname and size exmaples
grep: Edited -c description
ps: Added wide lines example
ssh: edited -D description, added simple port forwarding example
unzip: added list option
2014-02-10 20:36:05 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Sort a file in ascending order:
|
A bunch of new pages:
common/: dig, gzip, rm, sort, zfs, zpool
linux/: apt-get, shutdown
osx/: airport, caffeinate, diskutil, networksetup open, pgrep, qlmanage, say, shutdown, sysctl, system_profiler
Edits to existing pages:
curl: Added simple download example
find: Added iname and size exmaples
grep: Edited -c description
ps: Added wide lines example
ssh: edited -D description, added simple port forwarding example
unzip: added list option
2014-02-10 20:36:05 +00:00
|
|
|
|
2020-09-09 11:33:24 +01:00
|
|
|
`sort {{path/to/file}}`
|
A bunch of new pages:
common/: dig, gzip, rm, sort, zfs, zpool
linux/: apt-get, shutdown
osx/: airport, caffeinate, diskutil, networksetup open, pgrep, qlmanage, say, shutdown, sysctl, system_profiler
Edits to existing pages:
curl: Added simple download example
find: Added iname and size exmaples
grep: Edited -c description
ps: Added wide lines example
ssh: edited -D description, added simple port forwarding example
unzip: added list option
2014-02-10 20:36:05 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Sort a file in descending order:
|
A bunch of new pages:
common/: dig, gzip, rm, sort, zfs, zpool
linux/: apt-get, shutdown
osx/: airport, caffeinate, diskutil, networksetup open, pgrep, qlmanage, say, shutdown, sysctl, system_profiler
Edits to existing pages:
curl: Added simple download example
find: Added iname and size exmaples
grep: Edited -c description
ps: Added wide lines example
ssh: edited -D description, added simple port forwarding example
unzip: added list option
2014-02-10 20:36:05 +00:00
|
|
|
|
2020-09-09 11:33:24 +01:00
|
|
|
`sort -r {{path/to/file}}`
|
A bunch of new pages:
common/: dig, gzip, rm, sort, zfs, zpool
linux/: apt-get, shutdown
osx/: airport, caffeinate, diskutil, networksetup open, pgrep, qlmanage, say, shutdown, sysctl, system_profiler
Edits to existing pages:
curl: Added simple download example
find: Added iname and size exmaples
grep: Edited -c description
ps: Added wide lines example
ssh: edited -D description, added simple port forwarding example
unzip: added list option
2014-02-10 20:36:05 +00:00
|
|
|
|
2018-11-25 20:29:28 +00:00
|
|
|
- Sort a file in case-insensitive way:
|
|
|
|
|
2020-09-09 11:33:24 +01:00
|
|
|
`sort --ignore-case {{path/to/file}}`
|
2018-11-25 20:29:28 +00:00
|
|
|
|
2016-05-10 14:09:55 +01:00
|
|
|
- Sort a file using numeric rather than alphabetic order:
|
2016-03-30 16:13:36 +01:00
|
|
|
|
2020-09-09 11:33:24 +01:00
|
|
|
`sort -n {{path/to/file}}`
|
2016-03-30 16:13:36 +01:00
|
|
|
|
2016-05-10 14:12:37 +01:00
|
|
|
- Sort the passwd file by the 3rd field, numerically:
|
|
|
|
|
|
|
|
`sort -t: -k 3n /etc/passwd`
|
|
|
|
|
2016-03-30 16:13:36 +01:00
|
|
|
- Sort a file preserving only unique lines:
|
|
|
|
|
2020-09-09 11:33:24 +01:00
|
|
|
`sort -u {{path/to/file}}`
|
2018-10-16 18:29:50 +01:00
|
|
|
|
|
|
|
- Sort human-readable numbers (in this case the 5th field of `ls -lh`):
|
|
|
|
|
|
|
|
`ls -lh | sort -h -k 5`
|
2020-09-09 11:33:24 +01:00
|
|
|
|
|
|
|
- Sort numbers with exponents:
|
|
|
|
|
|
|
|
`sort --general-numeric-sort {{path/to/file}}`
|