How to change the sort by for folders to type, because I want folders to be shown first and then files by name. When I sort by type, I get the result I want, but I need to change this for all my folders.

How can I change the default preference to sort by: type, so every folder will by default be sorted by type? I tried with dconf-editor, then org > gnome > nautilus > preferences and tried to choose type in default-sort-order, but I can only select modification_date, not by type.

up vote 15 down vote accepted

On Nemo (a recent fork of nautilus), I have the following in the menu :

  1. Edit > Preferences
  2. then on the Views tab
    • I got a section called Default View
    • with a line Arrange items, there is a select where I can choose the default sort order

Screenshot

http://imgur.com/OO2lMIz

  • It says installing Nemo will install Cinnamon too (webupd8.org/2012/12/how-to-install-nemo-file-manager-in.html). I wouldn't like to change anything now, if there is a solution without changes :) – bosniamaj Feb 8 '13 at 15:29
  • I never meant you to install Nemo, just show you the option exist in recent version. Which ubuntu and nautilus version do you use ? Add it to the question/description – Édouard Lopez Feb 8 '13 at 15:31
  • 1
    got similar settings on a nautilus 3.4.2. Did you close your nautilus and open it back ? – Édouard Lopez Feb 8 '13 at 15:39
  • Yes, I am a noob to the Ubuntu, sorry. I found the preference > default view. I didn't see it in the top bar, instead I was trying dconf-editor :( – bosniamaj Feb 8 '13 at 16:20
  • Thanks a lot! This has been bugging me for a long time.. Why isn't this the default?! – tsauerwein Aug 9 '14 at 12:03

update February 2017:

nautilus now has a configuration option to sort directories first (I think since 3.14 or so) so I recommend using that instead of changing the default sort order. It is literally the first item in GUI preferences.


initial post from May 2014

I see the same problems on Fedora 18 (using the same versions).

The first attempt using dconf directly via the command line does not work for me:

$ dconf write /org/gnome/nautilus/preferences/default-sort-order type
error: 0-4:unknown keyword

Now gsettings to the rescue:

$ gsettings set org.gnome.nautilus.preferences default-sort-order type

I'm not sure why dconf does not accept 'type' as a valid value even though dconf-editor explicitely lists it in the help text but gsettings works for me just fine.

  • 2
    Set by "modification time" using gsettings set org.gnome.nautilus.preferences default-sort-order mtime – Dave May 21 '13 at 23:09
  • user274121 added this explanation: "the quotes need to be passed to dconf" so dconf write /org/gnome/nautilus/preferences/default-sort-order \'type\' would be the correct call. – Felix Schwarz May 5 '14 at 8:29

Determine the current default value of Nautilus sort order using gsettings

gsettings get org.gnome.nautilus.preferences default-sort-order

Then change/set it to 'type'

gsettings set org.gnome.nautilus.preferences default-sort-order 'type'

The change happens instantly

In preferences -> Views -> Arrange Items

It has got 'By Type' in the drop down list.

If you can't see preferences in gnome-shell, click on the nautilus icon in the top panel

enter image description here

Change the reverse sort order settings for files(nautilus)/nemo on Ubuntu 14.04:

gsettings list-recursively | grep reverse

...

gsettings set org.nemo.preferences default-sort-in-reverse-order true    
gsettings set org.gnome.nautilus.preferences default-sort-in-reverse-order true

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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