Submit your Linux news story here.

How to open a file in read only mode under vi or vim

HHere is a nifty trick. You can open a file in read-only mode under vi or vim text editor. Opening read-only prevents any accidental edits in a file and maintain file integrity.

From the tutorial:

I need of opening necessary files in reading (read-only) mode to avoid accidental editing of files such as /etc/resolv.conf or a large config or programming file on a production server. How do I open files in read-only mode in vim text editor on Linux or Unix-like system?

Comments on this entry are closed.