Sort order when using ll












1















Is there a way to set the sort order of the files and directories when using the ll command? I have two 16.04.5 servers with two ext4 drives. One folder exists on both drives containing the same files. When using ll on both servers the sort order is not the same (ls -l has the same result):



ll on server a:



Alex.txt
iBoy.txt
Immatriculation.txt
Radius.txt
WonderWoman.txt


ll on server b:



Alex.txt
Immatriculation.txt
Radius.txt
WonderWoman.txt
iBoy.txt


So the difference is the file iBoy.txt. Is there a way to figure out why this file is not located between Alex.txt and Immatriculation.txt like on server a?



EDIT 1:



As requested, here are the locales of both systems.



locale on server a:



LANG=de_DE.UTF-8
LANGUAGE=
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=


locale on server b:



locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=de_DE.UTF-8
LANGUAGE=
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=









share|improve this question

























  • See also the ls info page

    – glenn jackman
    9 hours ago
















1















Is there a way to set the sort order of the files and directories when using the ll command? I have two 16.04.5 servers with two ext4 drives. One folder exists on both drives containing the same files. When using ll on both servers the sort order is not the same (ls -l has the same result):



ll on server a:



Alex.txt
iBoy.txt
Immatriculation.txt
Radius.txt
WonderWoman.txt


ll on server b:



Alex.txt
Immatriculation.txt
Radius.txt
WonderWoman.txt
iBoy.txt


So the difference is the file iBoy.txt. Is there a way to figure out why this file is not located between Alex.txt and Immatriculation.txt like on server a?



EDIT 1:



As requested, here are the locales of both systems.



locale on server a:



LANG=de_DE.UTF-8
LANGUAGE=
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=


locale on server b:



locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=de_DE.UTF-8
LANGUAGE=
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=









share|improve this question

























  • See also the ls info page

    – glenn jackman
    9 hours ago














1












1








1








Is there a way to set the sort order of the files and directories when using the ll command? I have two 16.04.5 servers with two ext4 drives. One folder exists on both drives containing the same files. When using ll on both servers the sort order is not the same (ls -l has the same result):



ll on server a:



Alex.txt
iBoy.txt
Immatriculation.txt
Radius.txt
WonderWoman.txt


ll on server b:



Alex.txt
Immatriculation.txt
Radius.txt
WonderWoman.txt
iBoy.txt


So the difference is the file iBoy.txt. Is there a way to figure out why this file is not located between Alex.txt and Immatriculation.txt like on server a?



EDIT 1:



As requested, here are the locales of both systems.



locale on server a:



LANG=de_DE.UTF-8
LANGUAGE=
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=


locale on server b:



locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=de_DE.UTF-8
LANGUAGE=
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=









share|improve this question
















Is there a way to set the sort order of the files and directories when using the ll command? I have two 16.04.5 servers with two ext4 drives. One folder exists on both drives containing the same files. When using ll on both servers the sort order is not the same (ls -l has the same result):



ll on server a:



Alex.txt
iBoy.txt
Immatriculation.txt
Radius.txt
WonderWoman.txt


ll on server b:



Alex.txt
Immatriculation.txt
Radius.txt
WonderWoman.txt
iBoy.txt


So the difference is the file iBoy.txt. Is there a way to figure out why this file is not located between Alex.txt and Immatriculation.txt like on server a?



EDIT 1:



As requested, here are the locales of both systems.



locale on server a:



LANG=de_DE.UTF-8
LANGUAGE=
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=


locale on server b:



locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=de_DE.UTF-8
LANGUAGE=
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=






16.04 command-line files directory ext4






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 9 hours ago







Socrates

















asked 9 hours ago









SocratesSocrates

7971230




7971230













  • See also the ls info page

    – glenn jackman
    9 hours ago



















  • See also the ls info page

    – glenn jackman
    9 hours ago

















See also the ls info page

– glenn jackman
9 hours ago





See also the ls info page

– glenn jackman
9 hours ago










1 Answer
1






active

oldest

votes


















3














ls' sort order is defined by your locale's collation setting. You can easily check this with the locale command:



$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=


Important for sorting is the LC_COLLATE value. In my example above, it would sort according to the rules for en_US.UTF.8 localization, which would sort file names case-insensitive and seems to ignore punctuation characters.



You can temporarily override your global settings with an environment variable. E.g. the C locale/collation would sort by the raw ASCII value, so all uppercase letters are before lowercase.



LC_COLLATE=C ll





share|improve this answer
























  • I tried that, but actually ls doesn’t acknowledge LC_COLLATE but only LC_ALL – oh wait, but with an empty LC_ALL it does work: LC_ALL= LC_COLLATE=C ll

    – dessert
    9 hours ago








  • 1





    @dessert LC_COLLATE is responsible for sorting. LC_ALL overrides all other LC_* values though if it is set, so if changing LC_COLLATE has no effect, I assume you have LC_ALL set to something else at the same time? When you just check the output of locale, LC_ALL should be empty.

    – Byte Commander
    9 hours ago








  • 1





    Alright, thanks both of you! I found out that I had the German locale "kind of" installed, so I installed it again with sudo locale-gen de_DE.UTF-8 followed by sudo update-locale and it now works perfectly.

    – Socrates
    8 hours ago











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1119866%2fsort-order-when-using-ll%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














ls' sort order is defined by your locale's collation setting. You can easily check this with the locale command:



$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=


Important for sorting is the LC_COLLATE value. In my example above, it would sort according to the rules for en_US.UTF.8 localization, which would sort file names case-insensitive and seems to ignore punctuation characters.



You can temporarily override your global settings with an environment variable. E.g. the C locale/collation would sort by the raw ASCII value, so all uppercase letters are before lowercase.



LC_COLLATE=C ll





share|improve this answer
























  • I tried that, but actually ls doesn’t acknowledge LC_COLLATE but only LC_ALL – oh wait, but with an empty LC_ALL it does work: LC_ALL= LC_COLLATE=C ll

    – dessert
    9 hours ago








  • 1





    @dessert LC_COLLATE is responsible for sorting. LC_ALL overrides all other LC_* values though if it is set, so if changing LC_COLLATE has no effect, I assume you have LC_ALL set to something else at the same time? When you just check the output of locale, LC_ALL should be empty.

    – Byte Commander
    9 hours ago








  • 1





    Alright, thanks both of you! I found out that I had the German locale "kind of" installed, so I installed it again with sudo locale-gen de_DE.UTF-8 followed by sudo update-locale and it now works perfectly.

    – Socrates
    8 hours ago
















3














ls' sort order is defined by your locale's collation setting. You can easily check this with the locale command:



$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=


Important for sorting is the LC_COLLATE value. In my example above, it would sort according to the rules for en_US.UTF.8 localization, which would sort file names case-insensitive and seems to ignore punctuation characters.



You can temporarily override your global settings with an environment variable. E.g. the C locale/collation would sort by the raw ASCII value, so all uppercase letters are before lowercase.



LC_COLLATE=C ll





share|improve this answer
























  • I tried that, but actually ls doesn’t acknowledge LC_COLLATE but only LC_ALL – oh wait, but with an empty LC_ALL it does work: LC_ALL= LC_COLLATE=C ll

    – dessert
    9 hours ago








  • 1





    @dessert LC_COLLATE is responsible for sorting. LC_ALL overrides all other LC_* values though if it is set, so if changing LC_COLLATE has no effect, I assume you have LC_ALL set to something else at the same time? When you just check the output of locale, LC_ALL should be empty.

    – Byte Commander
    9 hours ago








  • 1





    Alright, thanks both of you! I found out that I had the German locale "kind of" installed, so I installed it again with sudo locale-gen de_DE.UTF-8 followed by sudo update-locale and it now works perfectly.

    – Socrates
    8 hours ago














3












3








3







ls' sort order is defined by your locale's collation setting. You can easily check this with the locale command:



$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=


Important for sorting is the LC_COLLATE value. In my example above, it would sort according to the rules for en_US.UTF.8 localization, which would sort file names case-insensitive and seems to ignore punctuation characters.



You can temporarily override your global settings with an environment variable. E.g. the C locale/collation would sort by the raw ASCII value, so all uppercase letters are before lowercase.



LC_COLLATE=C ll





share|improve this answer













ls' sort order is defined by your locale's collation setting. You can easily check this with the locale command:



$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=


Important for sorting is the LC_COLLATE value. In my example above, it would sort according to the rules for en_US.UTF.8 localization, which would sort file names case-insensitive and seems to ignore punctuation characters.



You can temporarily override your global settings with an environment variable. E.g. the C locale/collation would sort by the raw ASCII value, so all uppercase letters are before lowercase.



LC_COLLATE=C ll






share|improve this answer












share|improve this answer



share|improve this answer










answered 9 hours ago









Byte CommanderByte Commander

64.8k27178298




64.8k27178298













  • I tried that, but actually ls doesn’t acknowledge LC_COLLATE but only LC_ALL – oh wait, but with an empty LC_ALL it does work: LC_ALL= LC_COLLATE=C ll

    – dessert
    9 hours ago








  • 1





    @dessert LC_COLLATE is responsible for sorting. LC_ALL overrides all other LC_* values though if it is set, so if changing LC_COLLATE has no effect, I assume you have LC_ALL set to something else at the same time? When you just check the output of locale, LC_ALL should be empty.

    – Byte Commander
    9 hours ago








  • 1





    Alright, thanks both of you! I found out that I had the German locale "kind of" installed, so I installed it again with sudo locale-gen de_DE.UTF-8 followed by sudo update-locale and it now works perfectly.

    – Socrates
    8 hours ago



















  • I tried that, but actually ls doesn’t acknowledge LC_COLLATE but only LC_ALL – oh wait, but with an empty LC_ALL it does work: LC_ALL= LC_COLLATE=C ll

    – dessert
    9 hours ago








  • 1





    @dessert LC_COLLATE is responsible for sorting. LC_ALL overrides all other LC_* values though if it is set, so if changing LC_COLLATE has no effect, I assume you have LC_ALL set to something else at the same time? When you just check the output of locale, LC_ALL should be empty.

    – Byte Commander
    9 hours ago








  • 1





    Alright, thanks both of you! I found out that I had the German locale "kind of" installed, so I installed it again with sudo locale-gen de_DE.UTF-8 followed by sudo update-locale and it now works perfectly.

    – Socrates
    8 hours ago

















I tried that, but actually ls doesn’t acknowledge LC_COLLATE but only LC_ALL – oh wait, but with an empty LC_ALL it does work: LC_ALL= LC_COLLATE=C ll

– dessert
9 hours ago







I tried that, but actually ls doesn’t acknowledge LC_COLLATE but only LC_ALL – oh wait, but with an empty LC_ALL it does work: LC_ALL= LC_COLLATE=C ll

– dessert
9 hours ago






1




1





@dessert LC_COLLATE is responsible for sorting. LC_ALL overrides all other LC_* values though if it is set, so if changing LC_COLLATE has no effect, I assume you have LC_ALL set to something else at the same time? When you just check the output of locale, LC_ALL should be empty.

– Byte Commander
9 hours ago







@dessert LC_COLLATE is responsible for sorting. LC_ALL overrides all other LC_* values though if it is set, so if changing LC_COLLATE has no effect, I assume you have LC_ALL set to something else at the same time? When you just check the output of locale, LC_ALL should be empty.

– Byte Commander
9 hours ago






1




1





Alright, thanks both of you! I found out that I had the German locale "kind of" installed, so I installed it again with sudo locale-gen de_DE.UTF-8 followed by sudo update-locale and it now works perfectly.

– Socrates
8 hours ago





Alright, thanks both of you! I found out that I had the German locale "kind of" installed, so I installed it again with sudo locale-gen de_DE.UTF-8 followed by sudo update-locale and it now works perfectly.

– Socrates
8 hours ago


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1119866%2fsort-order-when-using-ll%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Category:香港粉麵

List *all* the tuples!

Channel [V]