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.

How to Delete Encrypted Files

Hello, I encrypted some file using the commands in Terminal. However, Those files are now disc and under disc utility and cannot be deleted. Whenever I move the disc to the trash they just "eject" and has no deleting option. I tried erasing them through Disk Utility but it fails to erase. How can I get rid of these files?

MacBook

Posted on Sep 9, 2019 10:21 PM

Reply
Question marked as Top-ranking reply

Posted on Sep 11, 2019 3:24 AM

A disk image is a single file, with extension .dmg

When you double click it, it "mounts" as disk drive, and you can copy, move, delete files in it.


A) If you want to throw the whole disk image away (ALL the files and the "disk" itself will be deleted):


1) eject (as you have done already)

2) drag the .dmg file to the Trash

3) empty the Trash


B) If you want just to delete SOME files inside the disk image:


1) mount the disk image (if it is not already) by double-clicking and entering the password

2) drag files from the "disk" to the Trash

3) empty the Trash

4 replies
Question marked as Top-ranking reply

Sep 11, 2019 3:24 AM in response to Pomonz

A disk image is a single file, with extension .dmg

When you double click it, it "mounts" as disk drive, and you can copy, move, delete files in it.


A) If you want to throw the whole disk image away (ALL the files and the "disk" itself will be deleted):


1) eject (as you have done already)

2) drag the .dmg file to the Trash

3) empty the Trash


B) If you want just to delete SOME files inside the disk image:


1) mount the disk image (if it is not already) by double-clicking and entering the password

2) drag files from the "disk" to the Trash

3) empty the Trash

Sep 10, 2019 11:16 PM in response to Pomonz

What was the exact command you used to encrypt the files?


It sounds like you made a disk image. A disk image will appear like a connected drive when it is mounted and which can also be ejected. If the disk image is writable, then you should be able to move the file within the image to the Trash. Otherwise eject the disk image and locate the .dmg image file and delete it. All the clues will be contained in the Terminal app's history as to the commands you used and the name & location of the .dmg file.

How to Delete Encrypted Files

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