0

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 ?

1 Answer 1

3

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:

ls

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.

You must log in to answer this question.

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