Where are the files that gedit autosaves?

Asked by Endolith

I had gedit open with some unsaved text, and everything crashed. It had been open for several minutes, so gedit should have autosaved it, but it was empty when I reopened it. Where are the autosave files stored?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
corenominal
Solved:
Last query:
Last reply:
Revision history for this message
corenominal (corenominal) said :
#1

Hi Endolith,

If you have the gedit option set to "Create a backup copy of files before saving" then the backup file should be saved in the same directory as the working file. The back file will have the same name as the working file except that it will be hidden (the file name is suffixed with a "~" character). To view the file in Nautilus, navigate to the file directory and then from Nautilus's menu go:

View -> Show Hidden Files

You should now be able to see your file, if it exists. Hopefully the contents of your file are safe. Also as far as I know, the "Create a backup copy of files before saving" is on by default - so unless you have turned it off you should be good.

Hope this helps :)

Revision history for this message
Endolith (endolith) said :
#2

I never saved the text, though. Does gedit autosave unsaved documents?

Revision history for this message
Wrwrwr (wrwrwr) said :
#3

Not on default, but there's an option for that in preferences-->editor.

Revision history for this message
Endolith (endolith) said :
#4

Yes, autosave and auto-backup were turned on, but if I *never* saved the text, where would the autosave be located?

Revision history for this message
Best corenominal (corenominal) said :
#5

Hi Endolith

I couldn't be sure but if you *never* saved the file and you only had it open for "several" minutes then you have probably lost any changes you made.

I have run a couple of tests [for my own sanity] and it appears as if the autosave feature only works when you are working on a previously saved file. I thought it might have autosaved to your home directory with a name like "Unsaved Document 1~", unfortunately from what I can tell, it doesn't.

Maybe you could raise this with the gedit developers as either a bug or feature request.

Sorry I couldn't be of more help :|

Revision history for this message
Endolith (endolith) said :
#6

Thanks Philip Newborough, that solved my question.

Revision history for this message
Endolith (endolith) said :
#7

"it appears as if the autosave feature only works when you are working on a previously saved file."

That's what I suspected.