Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 03-13-2004, 11:11 AM   #1
LQ Newbie
Registered: Jun 2003
Posts: 12

Rep: Reputation: 0
Alphabetical Listing of Text

I have a text file with the names of a bunch of people. How can I make it so that they are listed alphabetically from their last name?

For example:
George Washington
George Bush
Richard Nixon

I want that to become:
George Bush
Richard Nixon
George Washington
Old 03-13-2004, 11:34 AM   #2
Mingus Rockbutt
LQ Newbie
Registered: Mar 2004
Posts: 1

Rep: Reputation: 0
providing everyone has only a first and a surname just use
sort +1 filename
, or to confuse the issue,
sort -k 2 filename'
(both sort using the second field in the text).


Last edited by Mingus Rockbutt; 03-13-2004 at 11:37 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How change text color using linux in text mode only runlevel 3? Xavius Linux - General 7 05-07-2009 02:19 AM
Which light text editor can copy text from file and paste in browser? davidas Linux - Software 9 03-06-2006 11:28 AM
Show LFs & TABs in listing text files fiomba Linux - Software 0 12-02-2005 03:58 AM
Alphabetical sort wierdness SuperNull Linux - General 2 11-18-2005 12:21 AM
How to find and change a specific text in a text file by using shell script Bassam Programming 1 07-18-2005 07:15 PM

All times are GMT -5. The time now is 10:41 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration