When you have specific files or folders that you no longer want, you can delete them from your Mac to tidy up your desktop or free up more space. Instead of the traditional methods for deleting files on Mac, such as dragging and dropping files to the Mac Trash and right-clicking the file to choose Move to Trash, there are also keyboard shortcuts and command lines for deletion.
Delete on Mac keyboard shortcuts
Your productivity can be increased by using keyboard shortcuts. With the use of a keyboard shortcut, you may perform tasks on a computer that ordinarily demands the use of a mouse or trackpad and the pull-down menu on the screen.
Besides, when drag-and-drop does not work on Mac, you can try keyboard shortcuts. Here, we are going to introduce several Mac keyboard shortcuts for deleting.
Command + Delete
After you select the unwanted item, a file, a folder, or multiple items, press the Command and Delete keys, and you can move the selected items to the Mac Trash. You may need to confirm if the item is locked, just click continue, and you can move it to the Trash. The deleted files/folders are kept in the Trash.
Shift + Command + Delete
This key combination will empty the Trash and permanently remove them from your Mac. Command + Delete only moves the deleted files to the Mac Trash folder, and these items still occupy your disk space, or they will be emptied with the "Remove items from Trash after 30 days" enabled(check this from Finder > Settings > Advanced). To immediately empty the Mac Trash, just press Shift, Command, and Delete, then choose Continue to confirm.
Option + Shift + Command + Delete
If no need to confirm your intention and empty the Mac Trash, you can press the four keys at the same time: Option, Shift, Command, and Delete. The confirmation dialog will not prompt, and the sites kept in Mac Trash will be deleted permanently once you press, so use caution.
If the Delete button is not working on your Mac, check your keyboard connection or try to delete with command lines.
Mac Trash Won't Empty? Why & How to Force Empty Trash
Guide to fixing the MacBook Trash that won't empty in different scenarios and tell the reasons why you can't empty the Mac Trash. Also, available ways are offered for you to force empty the Trash on Mac. Read more >>
Delete on Mac command lines
In addition to keyboard shortcuts, you can also use command lines in the Terminal to delete files/folders on Mac. You can take it as an alternative way to erase multiple files or folders, empty Mac Trash when confronted with persistent issues, and delete files when Finder is not responding.
Warning: When using Terminal command lines, you should be very careful, given that you can't undo the operations. Backing up your Mac with Time Machine or another method is essential so that you can restore your Mac when unexpected errors occur.
- Open Terminal from your Utilities folder in Applications.
- Check which directory you're in by typing ls -la
- Navigate down a directory with cd [directoryname] or up a directory with cd ../
Then, type different command lines below based on your needs.
rm: delete files
You can delete single or multiple files on your Mac with the Terminal command rm. Just type rm filename (Replace the filename with the true name of the file you want to delete), then press Enter to run the command.
It will immediately delete the files without confirmation. If you're feeling cautious, you can use the -i flag to confirm the deletion, just type rm i filename and type yes.
rmdir: delete empty folders
The command line rmdir can help you remove an empty folder from a Mac using Terminal. The rmdir command is a little riskier, as you can't use the -i flag with it. Remember that only empty folders are deleted by this command line. Continue reading if you wish to delete a directory and the files contained.
rm -R: delete folders
Using the rm -R command deletes an entire folder, including all files, subfolders, and everything inside them. For further security, you can use the -i flag(rm -iR filename), which prompts you to confirm the deletion of each item.
Although this can be tedious, it's a safer option unless you're sure you want to remove everything.
If you accidentally delete files on a Mac, try iBoysoft Data Recovery to get them back!
Share Mac delete keyboard shortcuts and command lines!
The easiest way to delete files and folders on Mac
The above methods can help you effectively delete files and folders on Mac, but it is a bit complicated. For a simpler solution, try iBoysoft MagicMenu — a right-click enhancer that lets you permanently delete files with just a right-click.
- Download, install, and open iBoysoft MagicMenu on your Mac.
- Click Extension and find Delete Directly.
- Click the download button to add this feature to your right-click menu.
- Right-click the file you want to delete, and select Delete Directly.
Share this post with more people if you find it useful!