I am new to Ubuntu. I know I can open a file using vim in read-only mode by pass the -R option:
vim -R <filename> //Gives warning if I try to write
However, if I do the same thing with nano, I am able to write files freely:
nano -R <filename> //I can still write
What am I doing wrong? How can I open files in read-only mode using nano?
cat <filename>– linux4me May 25 '22 at 20:09-Rhas a constant OS-defined or OS-enforced meaning. That's not a valid assumption.-Rand similar flags are defined by each application. That's what happens when you have a thousand different developers and a thousand independent software projects. Ubuntu is a merely distributor ("distro") of upstream Open Source and Free Software projects, and cannot impose a standard upon them. – user535733 May 25 '22 at 22:15less -iM <filename>would be my preference. I usealias m=lesswithLESS = iMRj5Xin my~/.lesskey. Along with,and.as prev-file and next-file. Viewing files or piping into a pager is so common I want a 1-letter alias for it. (Andmformoreorlessis fun, and keeps it on a different letter thanlsorl.) – Peter Cordes May 26 '22 at 14:34nanohave syntax highlighting?lesshas all the other things you mentioned, being designed for viewing text files, with space for page-down since it's not an editor. – Peter Cordes May 26 '22 at 14:36