5

I want to add a new file to any directory by just one or two clicks. There is a way like using the terminal and touch command, but I want it to be easier so that it can be done by anybody. Is there a simple way to do this?

karel
  • 114,770
Sahin
  • 250

2 Answers2

3

To create 'new document' option in right click menu, do the following: Check if Templates directory exists:

ls ~/Templates

If it doesn't exist, create the directory:

mkdir ~/Templates

Now, to create templates of the desired new documents, it is sufficient to create them with the appropriate names in Templates directory. For instance, to create a template of empty document:

touch ~/Templates/'Empty Document'

Then you will find the option New Document/Empty Document in the right click menu in your file manager.

To create other document templates:

touch ~/Templates/'New Text Document.txt'

or

touch ~/Templates/New\ PNG\ Image.png

and so on...

Reference: https://ostechnix.com/how-to-add-new-document-option-in-right-click-context-menu-in-ubuntu-18-04/

Appo
  • 41
2

After looking for this I managed to do it by adding template files to Home/Templates directory. Firstly open an app, like text editor. (You can tap on start button and type text editor, it will pop up) Then click on save the file. (Ctrl+S or click on save) On the opening window, choose Templates directory and give the file a good name like "txt file". Click on save. You will see a button on right click on a folder named New Document. When you come on this New Document option, you will see the "txt file".

Adding file to the directory

Also: What is the "Templates" folder in the home directory for?

Sahin
  • 250