Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
    
A new file? A blank text file? Just run gedit & in terminal, write stuff in it and Ctrl+S to save. If you want to get feisty, in the terminal, type vim which is a lot more complicated than gedit. Terminal-> Ctrl +Alt+T –  drN Oct 29 '12 at 17:12
4  
As I wrote below, what I want to do is not to lose time while looking for the folder I'm working in. I could use a terminal but I still have to change directory (using cd). I could use gedit, but I will have to go manually to the folder where I want to create my new file. –  remjg Oct 29 '12 at 17:42
4  
I have a very complex folder organization which makes finding my current folder painful. For example, let's say I want to write a new LaTeX report at "~/Documents/University/Master/CourseX/ProjectY/Report/". I'll have to open Latexila/gedit, create a new file, select this folder after going through every parent folder and save it... Before I use to create my "Report" folder, a new blank file, rename it with .tex extension and that was it. –  remjg Oct 29 '12 at 17:54
1  
Oh... tell me about it! :P Just finishing my dissertation...What I actually do in that case is export curv=/home/username/Research/Dissertation/Draft/Curvature_effects/dftdata and then cd to say $curv and so on. I save all these file paths in a text file. You could perhaps put them in your .bashrc file (I've done that as well). Does save time... –  drN Oct 29 '12 at 17:59
1  
I use gnome-shell, I must say I'm quite satisfied with it. I had to learn how to use it, but I'm very efficient now (the Desktop Scroller extension helps switching workspaces quickly). –  remjg Oct 29 '12 at 18:09
show 3 more comments

4 Answers

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.

share|improve this answer
    
Thanks, I didn't know this command. But I still have to open a terminal at the desired location (ok nautilus-open-terminal can help me for that purpose). What I want to do is not to lose time to look for the folder I'm working in ! –  remjg Oct 29 '12 at 17:38
    
Yes I agree that this is very tedious in comparison to the old way. Not sure why they removed it - probably not many that used it or something. –  bjaanes Oct 29 '12 at 17:40
1  
Normal users don't need this feature, they could even be mistaken ("Hey, I want to create a new .doc file, why not creating a blank new text file ?"). I can understand it, but I need it : it was a very convenient way to create a new source code file at the right project location. –  remjg Oct 29 '12 at 17:47
    
I understand. I did not find any extension doing this sort of thing, but perhaps you could do the community a service and write one? ;) –  bjaanes Oct 29 '12 at 17:51
    
I'm currently learning how to code, would be a lot of fun and an interesting task for me to contribute to a free software ! But I must say I'm overwhelmed for now. I studied math in the past, I teached for two years, and I'm going back to the university directly in the second year of a computer science master... Well, it's tough ! –  remjg Oct 29 '12 at 17:59
add comment

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

You could even keybind it using accels.

share|improve this answer
    
Even if I have found the answer, it sounds like an interesting idea for those who want a keyboard shortcut ! –  remjg Oct 30 '12 at 15:44
    
If there still is the File->New Document->Empty Document entry, you can keybind it directly, no need for the script. –  user55822 Oct 30 '12 at 17:31
    
How do you do it ? –  remjg Oct 30 '12 at 20:48
2  
Accels are shortcuts assigned to each entry inside menus. Read that question and answer askubuntu.com/questions/136062/…. Applies to nautilus as well of course. –  user55822 Oct 30 '12 at 21:57
    
Thank you for your answer ! –  remjg Oct 31 '12 at 8:26
add comment
up vote 29 down vote accepted

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.

Creation of a new template file

share|improve this answer
    
This didn't work for me in Nautilus 3.6.3 –  szx Dec 26 '12 at 0:36
    
Strange, I've the same version as you. Maybe your Templates/ directory doesn't have the same name due to localisation settings ? –  remjg Dec 26 '12 at 14:31
    
No, the name is OK (I'm using English/US locale) –  szx Dec 26 '12 at 15:05
7  
Turns out this was caused by the XDG_TEMPLATE_DIR variable in ~/.config/user-dirs.dirs being set to $HOME rather than $HOME/Templates. –  szx Jan 11 '13 at 9:03
    
Glad to know you found a solution to your problem! –  remjg Jan 15 '13 at 16:02
show 2 more comments

I wrote an extension for Nautilus to restore this functionality. It's not perfect yet, but it's better than nothing and I will improve it in the future.

This extension is written in Python. It adds a context menu entry "New file" for the Nautilus file manager and allows user to create a new empty file.

Open source under GPL v3 or later licence. For more see http://byteptr.com/nnf/

share|improve this answer
1  
You might want to elaborate on it a bit, rather than just linking to it - What does it do, how does it work, how to use it? –  FEichinger Feb 6 '13 at 20:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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