I cannot understand when I am told I can remove some files, but others cannot be removed as I do not have permission.
How do I remove these stubborn files?
1. restart the computer
2. Ctrl+click on the file you want to unlock.
3. Select “Get Info.”
4.Click to expand the “General” section.
5. Locate the “Locked” checkbox and uncheck it.
If you can't and want to do it very quickly and own a terminal, then:
1. Open Terminal (Applications -> Utilities -> Terminal) and type the following command:
chflags nouchg /path/to/file
When the file is unlocked, you can delete it as usual.
You may get a delete error saying “You do not have permission to edit the file and delete”. Then do the following:
1. Ctrl+click the appropriate file.
2. Select Get Info.
3. Click to expand the “Sharing and Permissions” section. You will see a list of all user accounts registered on your Mac.
4. To authorize yourself to edit this file, click the little lock icon.
5. When prompted, enter your username and password.
6. Find your username in the list, click the corresponding set of arrows, then select Read & Write.
7.Delete unwanted file(s)
If it doesn't want to delete and it shows “file lock error”, “delete error”. then we do this:
Open terminal.
Type the command “sudo rm -R”, but do not press Enter.
Find the file you want to delete. Drag it into the terminal window. This will add the file name and path to the terminal command.
Enter the administrator password and press Enter.
Deleting files using the terminal requires extreme caution, as a small mistake can complicate things even further.