How To Permanently Delete A Single File From Mac Using Terminal

A very basic thing to do, but still not commonly known, is how to delete a single file permanently from your Mac. Moving a file to Trash means it’s still there and can be restored any time, not to mention eating up precious space. The slight problem with Trash is that if you want to remove a particular file from it, i.e., permanently delete it, you have to remove all of them. In the event you have just a single file to remove (wipe permanently off the face of your hard drive and the earth itself), you go to the Terminal and execute the simplest of commands.

Open Terminal, type “rm”  (no quotes, but there should be a space after it). Drag & drop the file you want to remove onto the Terminal window, and its path will be added at the end of the command, then hit Return. Your file will be removed beyond recovery.

This tip works for any and all files types and sizes, and is literally irreversible. Be extra cautious when using the command, and better if you use it only sparingly. To delete files of low priority, use Trash, which gives you some allowance for recovering a file if it was removed by accident.

For folders, use the command “rm –rf” followed by the path to the folder. Enter the command without quotes. Your folder and every single file in it will be removed permanently. This command is really the same one for deleting files, but modified slightly to tell Terminal that you want to remove a folder. It will have the same permanent effect mentioned when deleting a file, so proceed with caution.

قالب وردپرس

About Kelli Smith

Kelli Smith
Kelli runs customer support and creates content for Skillcrush, a digital skills training and education platform with friendly instructors, an active student community, and laser focus on helping you achieve your career goals with technology. She has an MBA and successfully ran an international company and her own freelancing business before pursuing her passion for tech by taking advanced web development classes. Kelli loves listening to tech podcasts at 2x speed, looking for cute Corgi photos online and teaching and performing country line dancing—as a true Texan living in Finland would do. Say hi on Twitter.

Leave a Reply

Your email address will not be published. Required fields are marked *