How Do I Make a File Read Only in Linux?
Contents You Can Use the Chmod Command to Set Read-Only Permission for All Files on a Linux / Unix / macOS / Apple Os X / *Bsd Operating Systems. How Do I Make...
Contents
You can use the chmod command to set read-only permission for all files on a Linux / Unix / macOS / Apple OS X / *BSD operating systems.
How do I make a text file read only in Linux?
You can alter a file’s permissions with the ‘chmod‘ command: Read-only to your UID (userid): chmod 400 <filename> Read-only to you and your GID (group): chmod 440 <filename>
Must Read
How do I make a file not editable in Linux?
Method #1: You can make file readonly by removing users’ write permission for a file. Under Linux and UNIX user cannot remove or modify file if they don’t have a write permission. You can use normal chmod command for this purpose.