The commands described below need to be entered while logged in to the Unix server. Normally you'll see a prompt ending with $ when the command interpreter (or shell) is ready for another command.
You can protect individual files by changing their permissions, by means of the chmod command (which stands for "change mode") to remove write permission. Use the command like this:
chmod u-w myfile
where u-w means "remove write permission for user" and myfile is the name of the file to be protected. Note however that this will also prevent the file content from being changed (edited).
Alternatively, you could move the file(s) into a subdirectory of their own and remove write permission from that subdirectory with the same command.
To reinstate write permission on the file, use the command
chmod u+w myfile
Please suggest an improvement
(login needed, link opens in new window)
Your views are welcome and will help other readers of this page.