gt – script to create a temp file in gedit


I am really lazy with my editors. I have aliases in my shell configuration for gedit and vim that are very basic:

alias v="vim -p" # open in tab
alias sv="sudo vim -p"
alias g="bgcmd gedit"
alias sg="bgcmd gksudo gedit"

This is very nice for me because I use my editors quite a bit. One thing I needed though was a command that would create and open a temporary file in gedit. The main reason for this is that at the time I don’t know how to name or place the file properly. Another reason is that at other times I like to have a scratchpad but would lose information if it was just a New File and a crash… happened.

Running just gt will create and open a file named of the current time (MMDDhhmm) and will be saved in the trash folder. If gt is followed by a name (e.g. gt cssbox or cssbox.css) the name will be appended to the current time.

Screenshot from 2013-08-26 08:17:12

The name is helpful if wanting to dig the file out of the trash folder at a later time.

About these ads

About Todd Partridge (Gently)

Good times, good people, good fun.

Posted on 2013-08-26, in Command Line, Linux, Script. Bookmark the permalink. Leave a comment.

Comments are closed.


Get every new post delivered to your Inbox.

Join 53 other followers

%d bloggers like this: