LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   unable to save and exit from vi editor (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-save-and-exit-from-vi-editor-843464/)

ramya victor 11-10-2010 10:47 AM

unable to save and exit from vi editor
 
i have done something while changing permission in vi editor. now when i open any file, i am not able to save and exit from it. when i type esc+shift:wq after opening a file. it says cant open file in write mode. please tell what to do? am a new user to fedora 9 and dont know much about it. please help

AlucardZero 11-10-2010 11:11 AM

*any* file? The file is probably just not writable. Or, you don't own the file. Or, the disk is full.

w1k0 11-10-2010 11:23 AM

Report here the results of two commands:

whoami

ls -l the.file.you.try.to.edit

In the command above -l is minus lowercase L.

ramya victor 11-20-2010 11:52 AM

when i open *.pl files i get this error. i can open all files from my root account but from my local login account i am not able to open perl files. but i am able to open *.c, *.php etc files.

Disillusionist 11-20-2010 12:03 PM

Have you checked the permissions as per the previous suggestions?

From a shell prompt, logged in with your standard user account type the following and post the results:
Code:

whoami
groups
ls -l file.pl

Please replace file.pl with the file you are experiencing problems with

honeybadger 11-20-2010 12:10 PM

Looks like vi permissions are messed up. I am not that good with vi but I think you have messed with the virc or vi.rc. Hopefully you do not get these errors when logged in as root.
Some options I have are:
1. try a different editor for the timebeing nano or emacs should be there.
2. Create a new user and see if he is able to edit all files.
3. Reinstall vi - if you have the cd/dvd very simple logic can help you reinstall - else you would need to look the rpm or the source code up.
Lesson: Make sure you back up system generated files - specially when you are root.


All times are GMT -5. The time now is 03:13 AM.