How do I automatically sort my files in Finder (hidden files included)

I want to sort all my directories automatically (not freely moving), similar to the / (Macintosh HD) directory, where when I turn on hidden files, all of them are automatically sorted by name.

So, like enter image description here

rather than enter image description here


Solution 1:

Right click and press Sort By -> Name or use View -> Sort By -> Name.