doubt in sort cmd

Go down

doubt in sort cmd Empty doubt in sort cmd

Post by lalitha on Fri Mar 12, 2010 6:25 pm

wat does sort -t "%" +2 -r filename do... tried this cmd many times...but not gettin any output
...also wy does this happen
[@oracleclient ~]$ cat sort12
98
101
45
56
34
67
66
77
1
2
4
45

[@oracleclient ~]$ sort -r sort12
98
77
67
66
56
45
45
4
34
2
101
1

[@oracleclient ~]$ cat>sort1
1
2
3
6
5
4
9
8
7
[@oracleclient ~]$ sort -r sort1
9
8
7
6
5
4
3
2
1

lalitha

Posts : 14
Points : 16
Join date : 2010-03-08

View user profile

Back to top Go down

doubt in sort cmd Empty Re: doubt in sort cmd

Post by akalya on Fri Mar 12, 2010 6:41 pm

use sort -nr filename

n stands for numeric sort

akalya

Posts : 70
Points : 86
Join date : 2010-03-04

View user profile

Back to top Go down

doubt in sort cmd Empty Re: doubt in sort cmd

Post by akalya on Fri Mar 12, 2010 6:47 pm

t is used to specify delimiter
[335802@oracleclient ~]$ cat sort3
123:345
456:678
321:654
789:000
000:678
267:678
[335802@oracleclient ~]$ sort -t ":" sort3
000:678
123:345
267:678
321:654
456:678
789:000
[335802@oracleclient ~]$ sort -t ":" -r sort3
789:000
456:678
321:654
267:678
123:345
000:678

akalya

Posts : 70
Points : 86
Join date : 2010-03-04

View user profile

Back to top Go down

doubt in sort cmd Empty Re: doubt in sort cmd

Post by lalitha on Fri Mar 12, 2010 6:52 pm

thanks akalya... Smile
wats tht +2 al tht
wy do v use tht

lalitha

Posts : 14
Points : 16
Join date : 2010-03-08

View user profile

Back to top Go down

doubt in sort cmd Empty Re: doubt in sort cmd

Post by Maithreyi on Fri Mar 12, 2010 7:18 pm

dnt use quotes

use grep aj* filename

use grep am. filename

Maithreyi

Posts : 76
Points : 142
Join date : 2010-03-03
Age : 31
Location : Haldia

View user profile

Back to top Go down

doubt in sort cmd Empty Re: doubt in sort cmd

Post by akalya on Fri Mar 12, 2010 7:21 pm

@lalitha
i donno abt +2.....
is there an option like tat???
i din find it in man sort!!!!

akalya

Posts : 70
Points : 86
Join date : 2010-03-04

View user profile

Back to top Go down

doubt in sort cmd Empty Re: doubt in sort cmd

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum