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. Method #2 : You need to use chattr command which changes the file attributes on a Linux second extended (ext2 / ext3) file system.
How do I remove a write-protected file in Linux?
If the file is write-protected, you will be prompted for confirmation, as shown below. To remove the file type y , and hit Enter . Otherwise, if the file is not write-protected, it will be deleted without prompting. To delete multiple files at once, use the rm command followed by the file names separated by space.
How do I change a write-protected file?
Permission Settings
- Sign in to your computer using an account with administrator privileges.
- Press “Windows-E” on the keyboard to launch File Explorer.
- Navigate to the location of the write-protected file.
- Right-click the file and select “Properties.”
- Select the “Security” tab, and then click the “Advanced” button.