Terminal command to arrange all files/folders by name on hard drive
Deleting .DS_Store SHOULD reset the appearance of a folder's content. 

BTW, the problem with the other answer could be the handling of special characters, which in my guess is space. 

For example, you have a home directory named "First Last". In find, the result it pipes out would be:

/Users/First Last/.DS_Store


etc. Try,

rm /Users/First Last/.DS_Store


would end in error, because the two properly escaped forms are:

rm  /Users/First\ Last/.DS_Store


or

rm "/Users/First Last/.DS_Store"


The correct way to go about it should be: run

find / -name ".DS_Store"


first to list all .DS_Store files. (Don't mind the Permission Denied.) Then

find / -name ".DS_Store" -delete


to delete all that you saw. Then

find / -name ".DS_Store"


again to confirm.

sudo is excessive. Unless you have used "sudo open -a Finder; killall Finder" before. A user's Finder has not have permission necessary to create .DS_Store files in /Library, /System, etc.