It made by Python script.
Download it and change permission (chmod +x ./ksort)
and you can use it, if the system installed python.
$ ./ksort --help
usage: ksort [-h] [-v] [-i ID] [-s SYMBOL] [-p PRINTID] [-n NEWLINE] [-r]
[-f FILE]
[otherthings [otherthings ...]]
ksort for sorting string lines or sorting string lines in file
positional arguments:
otherthings
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-i ID, --field_id ID sorting filed id (start from 0), only one, it should
need -s option
-s SYMBOL, --field_symbol SYMBOL
field spliting symbol (space ex: space for all white
space, ' ' for only one space, it should need -i
option)
-p PRINTID, --print_field PRINTID
print field id(start from 0) (ex: 1,3,...), it should
need -i and -s option
-n NEWLINE, --newline NEWLINE
new line symbol (default: Linux (\n))
-r, --reverse reverse sort
-m, --num numerical sort
-f FILE, --file FILE Input text file
example)
sorting string:
./ksort "1
6
9
3
2
7"
reverse sorting string:
./ksort -r "1
6
9
3
2
7"
sorting file size :
./ksort -i 4 -s space "$(ls -l)"
sorting file size reverse:
./ksort -i 4 -s space -r "$(ls -l)"
sorting file size, and print size and filename: