If you have installed RedHat 7.x reciently, you might have noticed a problem with the way the \”ls\” command sorts files and directories. In versions before 7.x, \”ls\” sorted dot files first then directories (uppercase then lower case)
next. However, in 7.x (I noticed it in 7.1, but in usenet postings/mailing list messages others noticed it in 7.0), \”ls\” sorts alphabetically only; mixing dotfiles (upper and lower case) with directories (upper and lower case). Ick!

Here\’s the fix. Add this to your .bash_profile or .profile:

export LC_COLLATE=C

That\’s it! After this change, \”ls\” sorts the way the Unix Gods intened. :-)