Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Ubuntu 10.04, there is a file that appears when I use the ls command with ~ right next to its name, like:

file.c ~

I can't open it, rename it, or copy it.

When I try to access it, I get the error:

"cannot stat 'file.c' : No such file or directory."

How can I open or restore this file ?

share|improve this question

migrated from Dec 2 '11 at 12:55

This question came from our site for professional and enthusiast programmers.

Files that ended with ~ are usually temporary files or backup files generated by other programs such as editors.

Most of the time this behavior can be corrected.

In your case, you have to be sure that this file still exists:


If the file appears, then you can edit it or rename it like this:

mv my-file.c~ new-name.c
nano my-file.c~

However if the file isn't there, that means that either you are in the wrong directory or the file has been deleted.

To recover your file there, are some tools that can be used to do so.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .