![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to unset the readonly variable | Nidhi2177 | UNIX for Advanced & Expert Users | 2 | 09-12-2007 05:35 AM |
| Readonly access | faruque.ahmed | UNIX for Dummies Questions & Answers | 13 | 01-31-2007 09:25 AM |
| DDD making problem | azazel11998 | High Level Programming | 0 | 03-10-2005 07:10 AM |
| pls hlp: making .sh files executable | ropers | Filesystems, Disks and Memory | 2 | 07-29-2002 05:44 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Making files readonly with vi?
Hi,
I'm new at this whole Unix thing, but definately learning (lots of fun)... and I was wondering - how do you make a file read-only with vi? I don't mean how do you load up vi in read-only mode, but how do you save a file (or flag a file, or whatever) in vi to read-only? How do you make it not read-only after it has been set to read-only? Thanks a lot! |
|
||||
|
See the man page for vi
view Start in read-only mode. You will be protected from writing the files. Can also be done with the "-R" argument. -R Read-only mode. The 'readonly' option will be set. You can still edit the buffer, but will be prevented from accidently overwriting a file. If you do want to overwrite a file, add an exclamation mark to the Ex command, as in ":w!". The 'readonly' option can be reset with ":set noro". See ":help 'readonly'". |
| Sponsored Links | ||
|
|