• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Sort by Name

Search This thread

AC1DZ

New member
Sep 30, 2021
2
0
I've noticed that my phone ( oneplus nord ) sorts numbers by 1,10,2,3,30,31 rather than 1,2,3,10,30,31 even when the sorting method is set to sort by name. The same happens with custom roms as well as the stock rom. Does anybody know a fix or workaround?
 

jwoegerbauer

Senior Member
Jul 11, 2009
7,554
26
1,757
European Union

sort​

usage: sort [-Mbcdfginrsuz] [FILE...] [-k#[,#[x]] [-t X]] [-o FILE]

Sort all lines of text from input files (or stdin) to stdout.
-M Month sort (jan, feb, etc)
-V Version numbers (name-1.234-rc6.5b.tgz)
-b Ignore leading blanks (or trailing blanks in second part of key)
-c Check whether input is sorted
-d Dictionary order (use alphanumeric and whitespace chars only)
-f Force uppercase (case insensitive sort)
-g General numeric sort (double precision with nan and inf)
-i Ignore nonprinting characters
-k Sort by "key" (see below)
-n Numeric order (instead of alphabetical)
-o Output to FILE instead of stdout
-r Reverse
-s Skip fallback sort (only sort with keys)
-t Use a key separator other than whitespace
-u Unique lines only
-x Hexadecimal numerical sort
-z Zero (null) terminated lines

Sorting by key looks at a subset of the words on each line. -k2 uses the
second word to the end of the line, -k2,2 looks at only the second word,
-k2,4 looks from the start of the second to the end of the fourth word.
-k2.4,5 starts from the fourth character of the second word, to the end
of the fifth word. Specifying multiple keys uses the later keys as tie
breakers, in order. A type specifier appended to a sort key (such as -2,2n)
applies only to sorting that key.
 
  • Like
Reactions: AC1DZ

Top Liked Posts

  • There are no posts matching your filters.
  • 1

    sort​

    usage: sort [-Mbcdfginrsuz] [FILE...] [-k#[,#[x]] [-t X]] [-o FILE]

    Sort all lines of text from input files (or stdin) to stdout.
    -M Month sort (jan, feb, etc)
    -V Version numbers (name-1.234-rc6.5b.tgz)
    -b Ignore leading blanks (or trailing blanks in second part of key)
    -c Check whether input is sorted
    -d Dictionary order (use alphanumeric and whitespace chars only)
    -f Force uppercase (case insensitive sort)
    -g General numeric sort (double precision with nan and inf)
    -i Ignore nonprinting characters
    -k Sort by "key" (see below)
    -n Numeric order (instead of alphabetical)
    -o Output to FILE instead of stdout
    -r Reverse
    -s Skip fallback sort (only sort with keys)
    -t Use a key separator other than whitespace
    -u Unique lines only
    -x Hexadecimal numerical sort
    -z Zero (null) terminated lines

    Sorting by key looks at a subset of the words on each line. -k2 uses the
    second word to the end of the line, -k2,2 looks at only the second word,
    -k2,4 looks from the start of the second to the end of the fourth word.
    -k2.4,5 starts from the fourth character of the second word, to the end
    of the fifth word. Specifying multiple keys uses the later keys as tie
    breakers, in order. A type specifier appended to a sort key (such as -2,2n)
    applies only to sorting that key.