How to add a new file in any directory by right-click add a new ...file (text, doc etc.) easily?
772
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?
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".
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.
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
To create 'new document' option in right click menu, do the following: Check if Templates directory exists:
If it doesn't exist, create the directory:
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:
Then you will find the option New Document/Empty Document in the right click menu in your file manager.
To create other document templates:
or
and so on...
Reference: https://ostechnix.com/how-to-add-new-document-option-in-right-click-context-menu-in-ubuntu-18-04/