02-16-2018
Explanation for sort utility and its detail
I tried to use sort utility and typed
sort --help, read one of lines; its
-k option, and part of it:
Quote:
OPTS is one or more single-letter ordering options [bdfgiMhnRrV], which override global ordering options for that key
I am really not getting it
Anyone do me a useful favor to save me out of my ignorance ?
Moderator's Comments:
|
|
Please use correct tags as required by forum rules!
|
|
Last edited by RudiC; 02-16-2018 at 09:01 AM..
Reason: Added ICODE/QUOTE tags.
This User Gave Thanks to abdulbadii For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I'd like to peruse a log file and from it generate another file from the first instance of "Jul 11" to the first instance of "Jul 18" within the log file. (3 Replies)
Discussion started by: Cameron
3 Replies
2. UNIX for Advanced & Expert Users
I have a problem with a submirror of the root filesystem,
in the procedure in order to unmirror the FS say:
metadetach -f d0 d20
metaroot c0t0d0s0
but, in my system the metaroot cause a segmentation fault coredump. I knew that the command modify the /etc/system and
the /etc/vfstab.
I try... (3 Replies)
Discussion started by: hugo_perez
3 Replies
3. Shell Programming and Scripting
Hi friends,
I want to use sort command in script. I used the following syntax in my scipt,
sort -t '|' +3 tempcdrext4.cdr > temp.mocdr
It give me a error " Input file specified two times."
but this command work fine in the prompt without any problem.
Can sombody please tell me who... (2 Replies)
Discussion started by: maheshsri
2 Replies
4. Solaris
Hi All,
My system patch detail is below
Generic_12712-11 sun4u .
can you please, what patch level is needed and where can i get it .
Thanks (9 Replies)
Discussion started by: kumarmani
9 Replies
5. UNIX for Dummies Questions & Answers
Hi all experts,
I want to find out what oracle product has come with the server and their version detail. We have Solaris 10. Can you tell me what Unix command will full fill this requirement?
Thanks,
AJ
-----Post Update-----
please help
-----Post Update-----
please help guys (1 Reply)
Discussion started by: ma466
1 Replies
6. Shell Programming and Scripting
Hi,
I need to zip/compress a data file and send to a vendor. The vendor does have only unzip utility and can accept only .ZIP files. I do not have zip utility in my server.
How do I zip/compress the file so that it can be deflated using unzip command ? I tried gzip & compress commands, but... (1 Reply)
Discussion started by: Sabari Nath S
1 Replies
7. Cybersecurity
As a root user i switch to a different user say "oratest". I would like to know the details like at what time did the switch ( su - oratest ) happen.
Are there any logs to check this
Thanks. (2 Replies)
Discussion started by: jjoy
2 Replies
8. AIX
I am mac end user learn some shell and applescripting
I am looking AIX as system admin as career and learning AIX p520
what is scope of AIX as admin and about technology in demand in market
I am confused, can anybody from AIX elaborate or mail me some experience
please: (1 Reply)
Discussion started by: himanshuk
1 Replies
9. UNIX for Dummies Questions & Answers
Hi everyone,
I am wondering if someone could please break down and explain the following sort command for me:
ls ${DEST_LOCATION}/${FILES} | sort -rt -k 4,4n | head -1
I have tried working it out using 'man sort', but on AIX there is not a great explanation of this function. I know that... (9 Replies)
Discussion started by: jimbojames
9 Replies
10. AIX
Hi ALL,
I always use du command for analyzing diskusage to housekeep a filesystem.
Can somebody tell the where first row filesize resides?
bash-3.2# df -gt /tmp
Filesystem GB blocks Used Free %Used Mounted on
/dev/hd3 16.50 10.01 6.49 61% /tmp
bash-3.2#
bash-3.2# pwd... (6 Replies)
Discussion started by: Thala
6 Replies
SORT(1) General Commands Manual SORT(1)
NAME
sort - sort a file of ASCII lines
SYNOPSIS
sort [-bcdfimnru] [-tc] [-o name] [+pos1] [-pos2] file ...
OPTIONS
-b Skip leading blanks when making comparisons
-c Check to see if a file is sorted
-d Dictionary order: ignore punctuation
-f Fold upper case onto lower case
-i Ignore nonASCII characters
-m Merge presorted files
-n Numeric sort order
-o Next argument is output file
-r Reverse the sort order
-t Following character is field separator
-u Unique mode (delete duplicate lines)
EXAMPLES
sort -nr file # Sort keys numerically, reversed
sort +2 -4 file # Sort using fields 2 and 3 as key
sort +2 -t: -o out # Field separator is :
sort +.3 -.6 # Characters 3 through 5 form the key
DESCRIPTION
Sort sorts one or more files. If no files are specified, stdin is sorted. Output is written on standard output, unless -o is specified.
The options +pos1 -pos2 use only fields pos1 up to but not including pos2 as the sort key, where a field is a string of characters delim-
ited by spaces and tabs, unless a different field delimiter is specified with -t. Both pos1 and pos2 have the form m.n where m tells the
number of fields and n tells the number of characters. Either m or n may be omitted.
SEE ALSO
comm(1), grep(1), uniq(1).
SORT(1)