When I recently shifted to Ubuntu 18.04, I noticed that there was no option in the right-click menu of Nautilus to create an empty text file. Of course, I could use the command line to quickly create a new document or even use the Text Editor to create a new file, but that is not what I wanted. I was still looking for the old style right-click menu that would help me in creating a new text file simply with a click or two.
When I looked for a way out, I realized that it was an easy fix to add my favorite option to the right-click menu. So I will share this tip with you, here in this article.
What comes to help is a folder named Templates in your home directory. Whatever you save in this folder, Ubuntu basically treats it as a template. We will be using this folder to solve our little problem here.
We have run the commands and procedures mentioned in this article on a Ubuntu 18.04 LTS system.
Add “New Document” option back through the UI
Let us create an empty text file through the Text editor and save it by the name of “Untitled Document” in the Templates folder, in our home directory.
Now, Nautius will treat this file as a Template and a right-click menu option will be created by the name of New Document through which you can open this empty text file.
Here is what you will see in the Nautilus right-click menu now:
Add “New Document” option back through the Command Line
Doing the same thing through the command line is even simpler. Let us assume that you have not enabled the right-click New Document option through the UI yet.
Open the Ubuntu command line, the Terminal, either through the system Dash or the Ctrl+Alt+T shortcut.
Then enter the following command in order to create an empty file by the name of Untitled Document in your Templates folder:
$ touch ~/Templates/"Untitled Document"
Once you do so, a right-click menu option will be created by the name of New Document through which you can open this empty text file named Untitled Document.
Through this quick tip, I hope you enjoy the same look and feel of the good old Nautilus menu just like I do!