You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Cannot unlock a file to make changes to permissions

I have an iso file on my desktop I want to delete. But it's locked.


Open Get Info, and the padlock is greyed out, and I can't unlock the file so I can delete it.


I'm logged in as the Administrator.


What do I need to do so I can unlock the padlock?

Mac mini 2018 or later

Posted on Nov 29, 2019 4:16 AM

Reply
Question marked as Top-ranking reply

Posted on Nov 29, 2019 11:06 AM

snowshed wrote:

Agreed. But I realize now, I should have posted I would like the file deleted. :-)



From the terminal you can copy and paste, then drag & drop the file to the Terminal window to auto complete the full path, there is one trailing space following the sudo rm -ri :


sudo rm -ri </drag your file here to complete the path>


so for example:


sudo rm -ri /Users/snowshed/Downloads/Windows.iso 


(please note—your psswd will not echo, type it in anyway, the terminal will ask for conformation before it executes the command, you have to verify or deny before it continues Y/N ? )

7 replies
Question marked as Top-ranking reply

Nov 29, 2019 11:06 AM in response to snowshed

snowshed wrote:

Agreed. But I realize now, I should have posted I would like the file deleted. :-)



From the terminal you can copy and paste, then drag & drop the file to the Terminal window to auto complete the full path, there is one trailing space following the sudo rm -ri :


sudo rm -ri </drag your file here to complete the path>


so for example:


sudo rm -ri /Users/snowshed/Downloads/Windows.iso 


(please note—your psswd will not echo, type it in anyway, the terminal will ask for conformation before it executes the command, you have to verify or deny before it continues Y/N ? )

Nov 29, 2019 6:30 AM in response to snowshed

Is the iso mounted?

If not, confirm it is in your Desktop folder?

Open Terminal and copy/paste this command and hit return:

ls -aleO@ ~/Desktop


It will spit out an entry for each file in the Desktop folder. Copy and paste the entire entry for that .iso file.

The name of the file will be at the right side of the output that will look something like this:

-rw-r--r--@  1 Barney  staff  -  562225 Jul 14 07:03 HMR_0058.JPG.jpeg
	com.apple.lastuseddate#PS	     16 
	com.apple.macl	    216 
	com.apple.quarantine	     21 
 0: group:everyone deny delete

You may or may not have any of the lines below the main entry for the iso, and they will not necessarily be the same as I've shown. If there are any lines at all below the main entry and before the next file entry, copy them all and paste into a reply here.

Nov 29, 2019 9:58 AM in response to Barney-15E

Barney-15E wrote:

Is the iso mounted?

No, it's just the ISO file. It's a Windows OS iso that I've copied to a windows computer.

f not, confirm it is in your Desktop folder?

It is in the downloads folder, and I can't move it to the Desktop. I can copy and paste, but not move.

pen Terminal and copy/paste this command and hit return:
ls -aleO@ ~/Desktop

I'm guessing, in the above command line, I could just change Desktop to Downloads, but I'm not familiar with Unix commands.

It will spit out an entry for each file in the Desktop folder. Copy and paste the entire entry for that .iso file.
The name of the file will be at the right side of the output that will look something like this:
-rw-r--r--@ 1 Barney staff - 562225 Jul 14 07:03 HMR_0058.JPG.jpeg
com.apple.lastuseddate#PS 16
com.apple.macl 216
com.apple.quarantine 21
0: group:everyone deny delete
You may or may not have any of the lines below the main entry for the iso, and they will not necessarily be the same as I've shown. If there are any lines at all below the main entry and before the next file entry, copy them all and paste into a reply here.

I'm guessing the above commands will still work, just on the downloads folder and not the desktop folder, but I don't want to make a bad situation worse.


Would you mind traking the time explain what each command is doing, in a general sense?


Thanks.



Nov 29, 2019 10:45 AM in response to snowshed

snowshed wrote:

I'm guessing the above commands will still work, just on the downloads folder and not the desktop folder, but I don't want to make a bad situation worse.





no harm in your copy and paste:


ls -aleO@ ~/Downloads


You can also simply drag the file to the terminal window after you enter the command, ex:

ls -elO@ <dragfilehere> for permissions and file flags and any extended attributes.

Nov 29, 2019 11:32 AM in response to leroydouglas

leroydouglas wrote:


snowshed wrote:

Agreed. But I realize now, I should have posted I would like the file deleted. :-)


From the terminal you can copy and paste, then drag & drop the file to the Terminal window to auto complete the full path, there is one trailing space following the sudo rm -ri :

sudo rm -ri </drag your file here to complete the path>

so for example:

sudo rm -ri /Users/snowshed/Downloads/Windows.iso

(please note—your psswd will not echo, type it in anyway, the terminal will ask for conformation before it executes the command, you have to verify or deny before it continues Y/N ? )

That's pretty darned cool!


From the time I bought my first computer, I've always known the real power is in the command line. But it's one of those things in life you'd like to learn, but more important responsibilities come first.


It worked, by the way. :-)


Thanks.

Cannot unlock a file to make changes to permissions

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.