136

I used to create new blank files in Nautilus (Files) using the right click context menu. It really saved me a lot of time. Since Nautilus 3.6, there is no such entry.

Is there a way to create a new blank file in Nautilus 3.6 and above?

Braiam
  • 69,112
remjg
  • 3,823

10 Answers10

191

Well, I filled a bug report on bugzilla.gnome.org and I feel stupid now... This feature still exists.

The solution is to create a blank file named for instance new inside the ~/Templates/ folder of your home directory.

On non-English installations, the templates directory might have another name. One can find the actual directory with xdg-user-dir TEMPLATES.

Creation of a new template file


If you're still facing the problem, Check the file in ~/.config/user-dirs.dirs if XDG_TEMPLATES_DIR variable is set correctly. If it is set to $HOME/ instead of $HOME/Templates/, correct and save that file.

Ola
  • 808
remjg
  • 3,823
26

Just create some file templates in your home Templates directory:

XDG_TEMPLATES_DIR=$(xdg-user-dir TEMPLATES)
cd "$XDG_TEMPLATES_DIR"
touch 'New Text File.txt' && touch 'New Word File.doc' && touch 'New Excel Spreadsheet.xls'

Go to any folder then, right click and you will see the "New Document" option with the templates you created.

muru
  • 207,228
Calin Rusu
  • 261
  • 3
  • 2
5

The name of the file must be Untitled Document In Ubuntu 20.04

touch ~/Templates/Untitled\ Document

This works for me

4

I can't really find this option in 3.6 either, but there are command line tools that can help you out (but it depends on what you are actually trying to accomplish here).

In a Terminal (CTRL+ALT+T) you can write the command:

 touch filename.ext 

This will create an empty file called filename.ext - you can call it whatever you want, with whatever extension (or no extension) you feel like.

3

This guy saved me. Just put an empty file in ~/Templates/ and you'll see an ability to duplicate it into any folder when you right-click and do into "New Document".

Íhor Mé
  • 282
2

I guess you could write a nautilus script with touch "New files.txt" in it.

You could even keybind it using accels.

user55822
  • 3,245
2

I installed nautilus-terminal.

It gives you a small embedded terminal inside Nautilus.

The directory in the embedded terminal is identical to the directory you are watching in nautilus.

So you can use the touch command there without opening a separate terminal and changing directories manually.

kos
  • 41,268
1

If you're on a localised Ubuntu version, you need to find the right translation for "Tempaltes". For example, on my French Ubuntu 20.04 version, "Templates" is called "Modèles"

1

To get back this functionality, I've written a simple guide http://bernaerts.dyndns.org/linux/344-nautilus-new-document-creation-menu to setup a customized right click contextual menu in Nautilus that allows you to create some empty documents fitted to your need.

For every document in the menu, you can set :

  • label and icon to use
  • the model to copy
  • the execute attribute (for shell script)

To allow this level of customisation, setup follows 3 steps :

  1. configuration of the list of document types in an INI file
  2. creation of document models for every document type
  3. generation of Nautilus action environment based on these types

This is supposed to provide a generic approach and to give some flexibility.

Hope it helps.

0

I use the create dopcument all the time in my www folder. unfortunately it seems to be broken when I upgraded to 14.04LTS. The Templates folder is missing in the root's home directory.

so this is how I fixed it. in my Templates folder in my home folder (you have to show hidden files btw) navigate there and for some reason it worked there. I right clicked and added the new document then I Right clicked and made a new document but I tittled the next one as newphp.php and another as newhtml.html

I edited both docs and included my default codes I used.

then I opened up a terminal and typed: gksu nautilus on the command line then navigated to the home directory that my computer boots into (default account), then copied the Templates folder (that I just made additional new files in ) then navigates to the root's home by clicking home in the nautilus menu that I launched as root, and paste the Templates folder in the root's home directory.