In /Home/Templates directory, we can put template file. So we can create new file by right clicking. Is there any way we can create new file which have current Date and Time. Something like log file. Which have date and Time as very first line. Or in the name of file.
This is not the solution for which I am looking for. But certainly good one.
Create a file and put following command
#!/bin/bash touch $(date +"%Y-%b-%d_%H:%M:%S")
Mark file for execution
chmod +x file
Or Right click on file and select properties. Under Permission tab, tick Allow executing file as program
dconf-editorand run it.
- Move to
- Right click on
- Select launch from drop down menu.
- Put that file in Templates folder.
- At any location (e.g. Desktop or Documents etc.), just right click and create that file there.
- Now double click it, it will create file with Date&Time as name.
Bash command for creating file with Name as DateTime and also as first line
#!/bin/bash echo $(date +"%Y-%b-%d_%H:%M:%S") > $(date +"%Y-%b-%d_%H:%M:%S")