This question already has an answer here:

I am a newbie user with a fresh install Ubuntu "Bionic Beaver" (v18.04), who has migrated from Windows 10. I want to make the file sorting order in Ubuntu match that of Windows, because that is how I have organised my (extensive) file archive. I think the answer lies in a post called "How do I force folder view sort order to not ignore special characters?", which says:

If you want collation to be equivalent to strcmp() sort order (i.e. do a >simple comparison of the code point values for the characters in the string), >you can switch to the legacy C locale for collation.

This can be done by editing ~/.profile and adding (or modifying) a line like >the following:


These instructions are too obscure for me to follow and I do not know where to find this ~/.profile, or how to edit it safely.

I hope someone will be able to give me explcit instructions on how to do this that are intelligible to someone of my inexperienced status.

marked as duplicate by muru command-line Jun 16 '18 at 12:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


In Ubuntu, files that start with a . are hidden by default.

~ is a symbol for your home directory located at /home/username (vs C:/Documents & Settings/Username in Windows (iirc).

This is where your Documents, Downloads, Pictures, Videos folders are. In Linux file addressing there is no leading drive name (C, D, F etc). This means that the file you are looking for is located in /home/username/.profile

You have two options for editing the file.

  1. Visit your home directory, and press CTRLH to show hidden files, find .profile and open it with your text editor and make the changes.

  2. Use the terminal and the inbuilt command-line file editor (called nano).

    • Open Terminal (I think CTRLAltT works as a shortcut)
    • Type: nano ~/.profile
    • Use the keypad to move your cursor to the bottom
    • Add export LC_COLLATE=C in a new line
    • Press CTRLX to exit
    • Press Y to confirm changes, then press ENTER to save.

Not the answer you're looking for? Browse other questions tagged or ask your own question.