Organizing Lists with the sort Command

GETTING SORTED

Article from Issue 52/2005
Author(s):

sort helps you organize file lists and program

output. And if you like, you can even use this small

but powerful tool to merge and sort multiple files.

The sort command allows you to

sort a file line by line. The command

can either process a specified

file or read from standard input. You

decide the sort criteria – sort has parameters

that give you granular control.

Simple Sorting Exercises

/etc/passwd is an excellent place to start

experimenting with sort. If you look

inside the file, you will see that the lines

comprise a number of fields, for example:

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Text Manipulation Tools

    Enjoy a crash course on some of the text-processing and -filtering capabilities found in Linux.

  • Ask Klaus!
  • User Monitoring

    Linux tracks all the actions that take place on your system, including when your users were active and what they did.

  • AJAX Workshop

    Books were the original model for website design. Navigation was similar to flipping the pages. Thanks to AJAX, many state-of-the-art websites now behave like desktop applications.

  • Command Line: Terminal Magic

    Far from an anachronism, the command line lives on as an indispensable part of the modern free desktop. Viva the command line!

comments powered by Disqus

Direct Download

Read full article as PDF:

Commandline_sort.pdf (354.09 kB)

News

njobs Europe
What:
Where:
Country:
Njobs Netherlands Njobs Deutschland Njobs United Kingdom Njobs Italia Njobs France Njobs Espana Njobs Poland
Njobs Austria Njobs Denmark Njobs Belgium Njobs Czech Republic Njobs Mexico Njobs India Njobs Colombia