[glug-t] One Day One GNU/Linux Command (SORT)
- From: Bharathi Subramanian <sbharathi@xxxxxxxxxxxxx>
- To: VEC-FOSS <vecfoss@xxxxxxxxxxxxxxxx>, GNU/Linux User Group of TCE <glugot@xxxxxxxxxxxxx>, GNU/Linux Users Group - Trichy <glug_t@xxxxxxxxxxxxx>
- Date: Wed, 14 May 2008 10:39:07 +0530 (IST)
One Day One GNU/Linux Command
=============================
sort - Sort lines of text files
Summary:
Sort the file contents based on options given to it.
By default the output is showed in the console.
Examples:
$ sort -- Take the input from stdin, sort and output
in stdout.
$ sort myfile -o myoutput -- Sort the myfile content
and store in "myoutput"
$ sort -b myfile -- Ignore the leading blanks and sort.
$ sort -br myfile -- Same as above but in reverse order
$ sort -c myfile -- Only Check whether myfile is already
sorted
$ sort -f myfile -- Ignore the case and sort (a == A)
$ sort -u myfile -- Sort and output only unique lines
$ sort -t : -k 2,2n -k 5.3,5.4 myfile
-- Sort numerically on the 2nd field and resolve
ties by sorting alphabetically on the 3rd and
4th characters of field 5. Use `:' as the
field delimiter
Read: man sort
HTH :)
--
Bharathi S
---------------------------------------------------------------
To unsubscribe send a mail to glug_t-request@xxxxxxxxxxxxx with
'unsubscribe' as subject.
Website: http://glugt.linuxisle.com
Other related posts:
- » [glug-t] One Day One GNU/Linux Command (SORT)