sort command in centos unix


 
Thread Tools Search this Thread
Operating Systems Linux sort command in centos unix
# 1  
Old 02-22-2012
Network sort command in centos unix

Iam working in centos linux operating system.
Consider the following file by name emp
1008 Vijay 40
1009 Rekha 34
1010 Shreyas 40
1011 Sanjay 40
sort command is not working. I gave sort emp
The command is not working
Can somebody send the options under centos linux
# 2  
Old 02-22-2012
sort

Quote:
Originally Posted by jpachar
Iam working in centos linux operating system.
Consider the following file by name emp
1008 Vijay 40
1009 Rekha 34
1010 Shreyas 40
1011 Sanjay 40
sort command is not working. I gave sort emp
The command is not working
Can somebody send the options under centos linux
Hi,

What is your sort constraints ?
I assume that, you are going to sort by name (second column).
Code:
sort -k 2 emp

if you use just
Code:
 sort emp

it will sort with first column by default.

Cheers,
RangaSmilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Jar command nor working in centos

Hi All, I have a jar file and I want to extract that jar file. I am using command jar xf Sample_Pack.jar After pressing enter this command returns no error and is not even executed. Pls help (1 Reply)
Discussion started by: Palak Sharma
1 Replies

2. Red Hat

How to Upgrade Centos 5.7 using Centos 5.8 ISO image on Vmware workstation

Dear Linux Experts, On my windows 7 desktop with the help of Vmware workstation (Version 7.1), created virtual machine and installed Centos 5.7 successfully using ISO image. Query : Is this possible to upgrade the Centos 5.7 using Centos 5.8 ISO image to Centos version 5.8?.. if yes kindly... (2 Replies)
Discussion started by: Ananthcn
2 Replies

3. Linux

sort command in centos linux os

Iam working on centos os. Iam not able to sort records without option Please help me out Jayaprakash B. (1 Reply)
Discussion started by: jpachar
1 Replies

4. UNIX for Dummies Questions & Answers

New to Unix command line and have a question about the "sort" command

I am going through the Unix Made Easy second edition book by John Muster. So far it's been very informative and I can tell it may be a bit out of date. In one of the exercises it talks about the "sort" command and using it to sort column's of data etc. The "sort" command has changed a bit and... (1 Reply)
Discussion started by: budfoxcat
1 Replies

5. UNIX for Advanced & Expert Users

Sort command using unix

Hello, I have a file with 'tab' separated columns. The first column of the file contains integer values. Now I want to sort the first column in ascending order. Can someone help me on this... thanks in advance (1 Reply)
Discussion started by: koneru_18
1 Replies

6. UNIX for Dummies Questions & Answers

CentOS using sudo command

Hi, this is my first time posting here and am new to linux/unix. So here is my question. I have two user account and a root account. root user account 1:calchen1 user account2: calchen2 Now i want to use the sudo utility to allows user to run programs with the privileges of another... (1 Reply)
Discussion started by: coolcalin812
1 Replies

7. Shell Programming and Scripting

How to Sort Floating Numbers Using the Sort Command?

Hi to all. I'm trying to sort this with the Unix command sort. user1:12345678:3.5:2.5:8:1:2:3 user2:12345679:4.5:3.5:8:1:3:2 user3:12345687:5.5:2.5:6:1:3:2 user4:12345670:5.5:2.5:5:3:2:1 user5:12345671:2.5:5.5:7:2:3:1 I need to get this: user3:12345687:5.5:2.5:6:1:3:2... (7 Replies)
Discussion started by: daniel.gbaena
7 Replies

8. UNIX for Dummies Questions & Answers

UNIX sort command

Need some help with the sort command. I have a large file which needs sorted on the third field separated by : and within the third field, I need it sorted by second field or everything after the . An example of my file is here and for example, the first line I need :ROUTER2.SFLDMI: sorted on the... (2 Replies)
Discussion started by: numele
2 Replies

9. UNIX for Dummies Questions & Answers

using Unix sort command

Hi I am having some difficulties with the UNIX sort command. I want to sort one a file that looks like this (file A): tiger 5 6 3 5 2 bear 4 5 2 1 8 lions 9 2 5 3 1 dogs 8 5 3 3 1 acccording to a file that looks like this (file B): dogs lions tiger bear So... (2 Replies)
Discussion started by: phil_heath
2 Replies

10. Shell Programming and Scripting

File size limitation of unix sort command.

hi , iam trying to sort millions of records which is delimited and i cant able to use sort command more than 60 million..if i try to do so i got an message stating that "File size limit exceeded",Is there any file size limit for using sort command.. How can i solve this problem. thanks ... (7 Replies)
Discussion started by: cskumar
7 Replies
Login or Register to Ask a Question