Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-15-2003, 10:00 PM   #1
LQ Newbie
Registered: Dec 2003
Distribution: Gentoo 2004.2
Posts: 20

Rep: Reputation: 0
Vi and read only files.

How do you save a read only file only file in Vi?
Old 12-15-2003, 10:09 PM   #2
Senior Member
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
You can't.

Either ^z out of vi and chmod the file, then press fg to get back in.


submit a chmod shell command from within vi.
Old 12-15-2003, 10:11 PM   #3
LQ Newbie
Registered: Dec 2003
Distribution: Gentoo 2004.2
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks for clearing that up.
Old 12-15-2003, 10:11 PM   #4
Senior Member
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Rep: Reputation: 45
Well, you edit it as the owner, maybe.
Or, you change the permissions before editing it, maybe.
But, maybe there's some sort of 'force it' option with :wq, but not that I know of.

(2 minutes late.. and a dollar short. )

Last edited by itsjustme; 12-15-2003 at 10:14 PM.
Old 12-15-2003, 10:37 PM   #5
Senior Member
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
If you own the file, then ":wq!" or ":x!" should overide the permissions just fine.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
mozzla problems-can not read files online, can not read attachments sarajevo Linux - Software 1 09-20-2005 07:58 PM
PDF fIles:how to read it sarajevo Debian 6 05-30-2005 01:14 PM
How to read files on cd Jack Techno Linux - Newbie 4 05-27-2005 11:41 PM
How program to read files with extension .dat y .cfg files COMTRADE in fedora 1? ivonne Linux - Software 0 11-22-2004 12:42 PM
Editing read-only files? zarathaz Mandriva 6 07-08-2004 02:51 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:35 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration