How to Sort Files by Extension in Ubuntu Nautilus

If you have been a long-time Ubuntu user, you have probably noticed the changes in Nautilus File manager relating to the ability to sort files by their extensions. The fact is the sort by “Type” feature in Nautilus has been revamped and simplified to the point that it is almost useless. Don’t understand what I mean?

Open your Nautilus and go to your Document folder. One thing you will notice is the “Arrange Items” option is missing from the context menu so you can’t easily sort your files/folders from the mouse’s right click.

nautilus-context-menu-arrange-items-option-missing

The way to sort your files is dependent on the View mode. In Icon mode, you have to go to “View -> By Type” to sort the files by type. In List mode, you can sort the items by clicking on the “Types” column header.

nautilus-sort-item-by-type

So you think the problem is solved? Well this is where the problem lies. For example, if you have multiple .pdf and .doc files, and you want to sort them according to their extension, you will be disappointed with the sort “By Type” option. It conveniently lumps all similar documents into groups and displays them in alphabetical order.

nautilus-document-type

From the image above, you can see that .docx and .pdf files are grouped under “Document.” This is the same for .txt and .csv extensions which are grouped under “Text” type. It is counter-inituitive in this case, and it would be more useful to be able to sort by extension.

A workaround for this is to make use of the MIME Type option in Nautilus. Here’s the fix:

1. In Nautilus, go to “Edit -> Preferences” followed by the “List Columns” tab. Check the box beside “MIME Type.” Close the Preferences window.

nautilus-enable-view-by-mime-type

2. Go to the folder where you want to sort your files, and make sure it is in List view. Next click the “MIME Type” column header to sort the files by MIME Type.

nautilus-sort-item-by-mime-type

That’s it. Your files should be sorted by their extension now.

Using Nemo as alternative file manager

For those who dislike this workaround, another method is to install Nemo and use it as a replacement for Nautilus. Nemo is a fork of Nautilus, and it is the default file manager in Cinnamon desktop.

You can easily install Nemo from Ubuntu Software Center, or alternatively, use the command below:

sudo apt-get install nemo

By default, Nemo has a column named “Detailed Type” (which is similar to the MIME Type in Nautilus) which you can easily click to sort the files by their extensions.

nemo-sort-item-by-detailed-type

In Icon mode, you can simply right click your mouse and arrange items by “Detailed Type” from the context menu. This makes it more user-friendly and easier for you to sort your files and folders.

nemo-arrange-item-icon-mode

Let us know if you have any other workaround to sort your files by extensions in Ubuntu.

Image credit: 2071785