Skip to content
Advertisement

A c program file on linux became green and now I cannot edit it

Hi I have a c file in program which is called helloQV.c

I ran the command gcc -Wall -ansi -std=c99 helloQV.c -o helloQV.c but now I cannot edit the file helloQV.c, when I open the file in vim it turns out to be just a bunch of random symbols. I realized I should have named the -o HelloQV.c to something different. What can I do to undo that change so I can re-edit my helloQV.c file.

Thanks

Advertisement

Answer

Your file showing up green on your terminal using ls means that your file is now an executable file because you’ve overwritten your file with gcc command. There is no way to get your original file back, I’m afraid.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement