Solved

Need help with "sort" command

Posted on 2004-04-01
2
408 Views
Last Modified: 2010-04-21
What would be the sort command if I wanted to sort the file by the last field (the fifth field)?

File sample:

,040606,20040401,            ,123456789,362 |
                                                           ^
                                                            |
                                                            |
                                                     This field
0
Comment
Question by:rlburris
2 Comments
 
LVL 7

Accepted Solution

by:
fim32 earned 250 total points
ID: 10733957
sort -n -t , -k 5

the -n is for numerically
0
 

Author Comment

by:rlburris
ID: 10734038
Thanks... the command was:

sort input.name -n -t, -k 5 -o output.name
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question