Nautilus: How are files sorted?












3














I am quite new to Debian 8.4. I am not sure if this is the right community on stackexchange to pose this question. Please tell me, if not.



My question: I am using the Nautilus file manager. I view a directory with some files in list view. Then I click on the bar with 'Name' on it. The order of sorting changes. My question is: How does Nautilus sort the files if I click on this button. More specifically, what is the sort order? e.g I have four files - and _ and a and b. If I have them sorted in ascending order (I call it this way, if a is before b) then _ will be before -. What is the general rule for sorting in Nautilus? And how could I find this information on my own - for example in the source code? I spent half an hour searching the web...










share|improve this question




















  • 2




    nautilus follows your locale collation rules (which determine the sort order).
    – don_crissti
    May 19 '16 at 23:38








  • 1




    @don_crissti Collation affects how it sorts the characters it chooses to sort. But the point here is that it ignores some when evaluating sort order.
    – underscore_d
    Oct 19 '16 at 18:35
















3














I am quite new to Debian 8.4. I am not sure if this is the right community on stackexchange to pose this question. Please tell me, if not.



My question: I am using the Nautilus file manager. I view a directory with some files in list view. Then I click on the bar with 'Name' on it. The order of sorting changes. My question is: How does Nautilus sort the files if I click on this button. More specifically, what is the sort order? e.g I have four files - and _ and a and b. If I have them sorted in ascending order (I call it this way, if a is before b) then _ will be before -. What is the general rule for sorting in Nautilus? And how could I find this information on my own - for example in the source code? I spent half an hour searching the web...










share|improve this question




















  • 2




    nautilus follows your locale collation rules (which determine the sort order).
    – don_crissti
    May 19 '16 at 23:38








  • 1




    @don_crissti Collation affects how it sorts the characters it chooses to sort. But the point here is that it ignores some when evaluating sort order.
    – underscore_d
    Oct 19 '16 at 18:35














3












3








3


4





I am quite new to Debian 8.4. I am not sure if this is the right community on stackexchange to pose this question. Please tell me, if not.



My question: I am using the Nautilus file manager. I view a directory with some files in list view. Then I click on the bar with 'Name' on it. The order of sorting changes. My question is: How does Nautilus sort the files if I click on this button. More specifically, what is the sort order? e.g I have four files - and _ and a and b. If I have them sorted in ascending order (I call it this way, if a is before b) then _ will be before -. What is the general rule for sorting in Nautilus? And how could I find this information on my own - for example in the source code? I spent half an hour searching the web...










share|improve this question















I am quite new to Debian 8.4. I am not sure if this is the right community on stackexchange to pose this question. Please tell me, if not.



My question: I am using the Nautilus file manager. I view a directory with some files in list view. Then I click on the bar with 'Name' on it. The order of sorting changes. My question is: How does Nautilus sort the files if I click on this button. More specifically, what is the sort order? e.g I have four files - and _ and a and b. If I have them sorted in ascending order (I call it this way, if a is before b) then _ will be before -. What is the general rule for sorting in Nautilus? And how could I find this information on my own - for example in the source code? I spent half an hour searching the web...







filenames sort nautilus






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 19 '16 at 21:51









Gilles

527k12710561580




527k12710561580










asked May 19 '16 at 18:25









user50224

1162




1162








  • 2




    nautilus follows your locale collation rules (which determine the sort order).
    – don_crissti
    May 19 '16 at 23:38








  • 1




    @don_crissti Collation affects how it sorts the characters it chooses to sort. But the point here is that it ignores some when evaluating sort order.
    – underscore_d
    Oct 19 '16 at 18:35














  • 2




    nautilus follows your locale collation rules (which determine the sort order).
    – don_crissti
    May 19 '16 at 23:38








  • 1




    @don_crissti Collation affects how it sorts the characters it chooses to sort. But the point here is that it ignores some when evaluating sort order.
    – underscore_d
    Oct 19 '16 at 18:35








2




2




nautilus follows your locale collation rules (which determine the sort order).
– don_crissti
May 19 '16 at 23:38






nautilus follows your locale collation rules (which determine the sort order).
– don_crissti
May 19 '16 at 23:38






1




1




@don_crissti Collation affects how it sorts the characters it chooses to sort. But the point here is that it ignores some when evaluating sort order.
– underscore_d
Oct 19 '16 at 18:35




@don_crissti Collation affects how it sorts the characters it chooses to sort. But the point here is that it ignores some when evaluating sort order.
– underscore_d
Oct 19 '16 at 18:35










4 Answers
4






active

oldest

votes


















0














Nautilus takes the "ls sort order" of the operating system (which is not always the same) and adds natural sorting to it.






share|improve this answer





























    0














    Read their source code here to understand how they have implemented sort:
    [Nautilus Source Code]1






    share|improve this answer








    New contributor




    Ankk98 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.


















    • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
      – Jeff Schaller
      8 hours ago



















    -1
















    Nautilus used to have these options :



    View >> Arrange Items >>>
    1 Manually
    2 By Name
    3 By Type
    4 By Modification Date
    5 By Emblems


    Suggest "By Name", then it should be alphabetical order.









    share|improve this answer

















    • 3




      thanks, but as I mentioned the problem is not the alphabet. How are _ and - treated? How is hierarchy? And where can I find the official way it is sorted?
      – user50224
      May 19 '16 at 19:14






    • 1




      @user50224 And where can I find the official way it is sorted? in the open source code, of course.
      – underscore_d
      Oct 19 '16 at 18:32





















    -1














    "_" or "-" or other symbols do not have any impact at all, only the following letters are relevant for sorting. It's really annoying but I guess sort options are too hard to code for the devs…






    share|improve this answer



















    • 1




      Are you sure about that this is generally the case? See the comment under OP's question, what's your collate setting? Also, did you find that out through trial and error or can you please cite any sources?
      – phk
      Jul 17 '16 at 15:22






    • 1




      but I guess sort options are too hard to code for the devs… Lame attempt at a dig. Rather it's probably a deliberate decision so that things sort lexically, by the intuitively sorted alphanumerical characters only - rather than expecting general users to know/remember/not be baffled by the arcane sorting order of non-alphanumeric characters in their particular collation. While you and I might be well versed in the old trick of 'put an underscore at the front so it sorts first', the general desktop user definitely would never predict this intuitively. GNOME aims to be inclusive of those users
      – underscore_d
      Oct 19 '16 at 18:37













    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    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: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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%2funix.stackexchange.com%2fquestions%2f284240%2fnautilus-how-are-files-sorted%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    4 Answers
    4






    active

    oldest

    votes








    4 Answers
    4






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Nautilus takes the "ls sort order" of the operating system (which is not always the same) and adds natural sorting to it.






    share|improve this answer


























      0














      Nautilus takes the "ls sort order" of the operating system (which is not always the same) and adds natural sorting to it.






      share|improve this answer
























        0












        0








        0






        Nautilus takes the "ls sort order" of the operating system (which is not always the same) and adds natural sorting to it.






        share|improve this answer












        Nautilus takes the "ls sort order" of the operating system (which is not always the same) and adds natural sorting to it.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 9 at 17:28









        damian101

        1




        1

























            0














            Read their source code here to understand how they have implemented sort:
            [Nautilus Source Code]1






            share|improve this answer








            New contributor




            Ankk98 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.


















            • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
              – Jeff Schaller
              8 hours ago
















            0














            Read their source code here to understand how they have implemented sort:
            [Nautilus Source Code]1






            share|improve this answer








            New contributor




            Ankk98 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.


















            • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
              – Jeff Schaller
              8 hours ago














            0












            0








            0






            Read their source code here to understand how they have implemented sort:
            [Nautilus Source Code]1






            share|improve this answer








            New contributor




            Ankk98 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            Read their source code here to understand how they have implemented sort:
            [Nautilus Source Code]1







            share|improve this answer








            New contributor




            Ankk98 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            share|improve this answer



            share|improve this answer






            New contributor




            Ankk98 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            answered 10 hours ago









            Ankk98

            11




            11




            New contributor




            Ankk98 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





            New contributor





            Ankk98 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






            Ankk98 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.












            • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
              – Jeff Schaller
              8 hours ago


















            • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
              – Jeff Schaller
              8 hours ago
















            While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
            – Jeff Schaller
            8 hours ago




            While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
            – Jeff Schaller
            8 hours ago











            -1
















            Nautilus used to have these options :



            View >> Arrange Items >>>
            1 Manually
            2 By Name
            3 By Type
            4 By Modification Date
            5 By Emblems


            Suggest "By Name", then it should be alphabetical order.









            share|improve this answer

















            • 3




              thanks, but as I mentioned the problem is not the alphabet. How are _ and - treated? How is hierarchy? And where can I find the official way it is sorted?
              – user50224
              May 19 '16 at 19:14






            • 1




              @user50224 And where can I find the official way it is sorted? in the open source code, of course.
              – underscore_d
              Oct 19 '16 at 18:32


















            -1
















            Nautilus used to have these options :



            View >> Arrange Items >>>
            1 Manually
            2 By Name
            3 By Type
            4 By Modification Date
            5 By Emblems


            Suggest "By Name", then it should be alphabetical order.









            share|improve this answer

















            • 3




              thanks, but as I mentioned the problem is not the alphabet. How are _ and - treated? How is hierarchy? And where can I find the official way it is sorted?
              – user50224
              May 19 '16 at 19:14






            • 1




              @user50224 And where can I find the official way it is sorted? in the open source code, of course.
              – underscore_d
              Oct 19 '16 at 18:32
















            -1












            -1








            -1








            Nautilus used to have these options :



            View >> Arrange Items >>>
            1 Manually
            2 By Name
            3 By Type
            4 By Modification Date
            5 By Emblems


            Suggest "By Name", then it should be alphabetical order.









            share|improve this answer














            Nautilus used to have these options :



            View >> Arrange Items >>>
            1 Manually
            2 By Name
            3 By Type
            4 By Modification Date
            5 By Emblems


            Suggest "By Name", then it should be alphabetical order.










            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered May 19 '16 at 18:50









            Knud Larsen

            988147




            988147








            • 3




              thanks, but as I mentioned the problem is not the alphabet. How are _ and - treated? How is hierarchy? And where can I find the official way it is sorted?
              – user50224
              May 19 '16 at 19:14






            • 1




              @user50224 And where can I find the official way it is sorted? in the open source code, of course.
              – underscore_d
              Oct 19 '16 at 18:32
















            • 3




              thanks, but as I mentioned the problem is not the alphabet. How are _ and - treated? How is hierarchy? And where can I find the official way it is sorted?
              – user50224
              May 19 '16 at 19:14






            • 1




              @user50224 And where can I find the official way it is sorted? in the open source code, of course.
              – underscore_d
              Oct 19 '16 at 18:32










            3




            3




            thanks, but as I mentioned the problem is not the alphabet. How are _ and - treated? How is hierarchy? And where can I find the official way it is sorted?
            – user50224
            May 19 '16 at 19:14




            thanks, but as I mentioned the problem is not the alphabet. How are _ and - treated? How is hierarchy? And where can I find the official way it is sorted?
            – user50224
            May 19 '16 at 19:14




            1




            1




            @user50224 And where can I find the official way it is sorted? in the open source code, of course.
            – underscore_d
            Oct 19 '16 at 18:32






            @user50224 And where can I find the official way it is sorted? in the open source code, of course.
            – underscore_d
            Oct 19 '16 at 18:32













            -1














            "_" or "-" or other symbols do not have any impact at all, only the following letters are relevant for sorting. It's really annoying but I guess sort options are too hard to code for the devs…






            share|improve this answer



















            • 1




              Are you sure about that this is generally the case? See the comment under OP's question, what's your collate setting? Also, did you find that out through trial and error or can you please cite any sources?
              – phk
              Jul 17 '16 at 15:22






            • 1




              but I guess sort options are too hard to code for the devs… Lame attempt at a dig. Rather it's probably a deliberate decision so that things sort lexically, by the intuitively sorted alphanumerical characters only - rather than expecting general users to know/remember/not be baffled by the arcane sorting order of non-alphanumeric characters in their particular collation. While you and I might be well versed in the old trick of 'put an underscore at the front so it sorts first', the general desktop user definitely would never predict this intuitively. GNOME aims to be inclusive of those users
              – underscore_d
              Oct 19 '16 at 18:37


















            -1














            "_" or "-" or other symbols do not have any impact at all, only the following letters are relevant for sorting. It's really annoying but I guess sort options are too hard to code for the devs…






            share|improve this answer



















            • 1




              Are you sure about that this is generally the case? See the comment under OP's question, what's your collate setting? Also, did you find that out through trial and error or can you please cite any sources?
              – phk
              Jul 17 '16 at 15:22






            • 1




              but I guess sort options are too hard to code for the devs… Lame attempt at a dig. Rather it's probably a deliberate decision so that things sort lexically, by the intuitively sorted alphanumerical characters only - rather than expecting general users to know/remember/not be baffled by the arcane sorting order of non-alphanumeric characters in their particular collation. While you and I might be well versed in the old trick of 'put an underscore at the front so it sorts first', the general desktop user definitely would never predict this intuitively. GNOME aims to be inclusive of those users
              – underscore_d
              Oct 19 '16 at 18:37
















            -1












            -1








            -1






            "_" or "-" or other symbols do not have any impact at all, only the following letters are relevant for sorting. It's really annoying but I guess sort options are too hard to code for the devs…






            share|improve this answer














            "_" or "-" or other symbols do not have any impact at all, only the following letters are relevant for sorting. It's really annoying but I guess sort options are too hard to code for the devs…







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jul 17 '16 at 15:35









            phk

            3,97652152




            3,97652152










            answered Jul 17 '16 at 14:56









            piedro

            1




            1








            • 1




              Are you sure about that this is generally the case? See the comment under OP's question, what's your collate setting? Also, did you find that out through trial and error or can you please cite any sources?
              – phk
              Jul 17 '16 at 15:22






            • 1




              but I guess sort options are too hard to code for the devs… Lame attempt at a dig. Rather it's probably a deliberate decision so that things sort lexically, by the intuitively sorted alphanumerical characters only - rather than expecting general users to know/remember/not be baffled by the arcane sorting order of non-alphanumeric characters in their particular collation. While you and I might be well versed in the old trick of 'put an underscore at the front so it sorts first', the general desktop user definitely would never predict this intuitively. GNOME aims to be inclusive of those users
              – underscore_d
              Oct 19 '16 at 18:37
















            • 1




              Are you sure about that this is generally the case? See the comment under OP's question, what's your collate setting? Also, did you find that out through trial and error or can you please cite any sources?
              – phk
              Jul 17 '16 at 15:22






            • 1




              but I guess sort options are too hard to code for the devs… Lame attempt at a dig. Rather it's probably a deliberate decision so that things sort lexically, by the intuitively sorted alphanumerical characters only - rather than expecting general users to know/remember/not be baffled by the arcane sorting order of non-alphanumeric characters in their particular collation. While you and I might be well versed in the old trick of 'put an underscore at the front so it sorts first', the general desktop user definitely would never predict this intuitively. GNOME aims to be inclusive of those users
              – underscore_d
              Oct 19 '16 at 18:37










            1




            1




            Are you sure about that this is generally the case? See the comment under OP's question, what's your collate setting? Also, did you find that out through trial and error or can you please cite any sources?
            – phk
            Jul 17 '16 at 15:22




            Are you sure about that this is generally the case? See the comment under OP's question, what's your collate setting? Also, did you find that out through trial and error or can you please cite any sources?
            – phk
            Jul 17 '16 at 15:22




            1




            1




            but I guess sort options are too hard to code for the devs… Lame attempt at a dig. Rather it's probably a deliberate decision so that things sort lexically, by the intuitively sorted alphanumerical characters only - rather than expecting general users to know/remember/not be baffled by the arcane sorting order of non-alphanumeric characters in their particular collation. While you and I might be well versed in the old trick of 'put an underscore at the front so it sorts first', the general desktop user definitely would never predict this intuitively. GNOME aims to be inclusive of those users
            – underscore_d
            Oct 19 '16 at 18:37






            but I guess sort options are too hard to code for the devs… Lame attempt at a dig. Rather it's probably a deliberate decision so that things sort lexically, by the intuitively sorted alphanumerical characters only - rather than expecting general users to know/remember/not be baffled by the arcane sorting order of non-alphanumeric characters in their particular collation. While you and I might be well versed in the old trick of 'put an underscore at the front so it sorts first', the general desktop user definitely would never predict this intuitively. GNOME aims to be inclusive of those users
            – underscore_d
            Oct 19 '16 at 18:37




















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • 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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2funix.stackexchange.com%2fquestions%2f284240%2fnautilus-how-are-files-sorted%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

            サソリ

            広島県道265号伴広島線

            Setup Asymptote in Texstudio