Different use of vi or vim editor for opening in read-only mode
There are some situations like we need to view a file but we accidentally typed or misspelled something and saved.This is threat to file integrity an hence needs to avoided.
The solution is view files by vi or vim command by read-only mode.
Simply open your file in view command and any attempt to alter or save changes will result in failure. If suppose you get into INSERT mode , you will get warning.
Using vi or vim command with -R option
The -R option is working same as the above one
--->> vi -R file name
using vi or vim command with -M option
-M = modifications are not allowed
All those three options are set for viewing a file in linux server/system in a secure way.
HostGliders:::Your Best Hosting partner