Emptying the mac trash. If the Recycle Bin Won't Empty: The Most Comprehensive Guide to Removing Locked Files. Disk recovery and access rights restoration

There is no other element in the Mac's interface as recognizable or well-known as the Trash, which now appears at the end of the Dock. You can get rid of almost any icon by dragging it onto the Trash Can icon (which looks more like a waste paper basket, but let's not quibble). When the cursor arrow touches the Recycle Bin icon, the Recycle Bin icon turns dark. By releasing the mouse button, you are firmly on the path to getting rid of everything you've been dragging. For clarity, Mac OS X even replaces the icon of an empty wastepaper basket with an icon of a basket full of crumpled paper, so that it is clear that there is something in it.

Advice Learn the keyboard equivalent of dragging something into the Trash: select the icon and press the -Delete keys. Not only is this technique much faster than drag-and-drop, it's also less demanding on precision, especially on a larger screen. Mac OS X handles the entire aiming process for the user.

Rescue folders and files in the Recycle Bin

Icons of folders and files lie in the Trash until the end of the world or until the user selects Finder>Empty Trash - whichever of these events occurs first.

If you have not yet emptied the Trash, you can open its window by clicking on the Trash icon. Now you can examine its contents - icons placed in the queue for destruction. Any of these objects can be saved by dragging it outside the Trash window.

Advice If your last action was dragging to the Trash, you can press the -Z keys - the equivalent of the Edit>Undo command. This will not only retrieve the item from the Recycle Bin, but also return it to its original folder. The trick works even if the Trash window is closed.

Emptying Trash 1: Quick and Easy

If you are sure that the items in the Trash are worth deleting, use any of three options:

Select Finder>Empty Trash.

Press Shift--Delete keys. And if you don't want to bother answering the request to confirm your intention, add an Option key.

Control-click the trash can icon (or right-click, or just click and hold for a moment) and select Empty Trash from the shortcut menu.

Rice. 2.11. Above: Final warning. Mac OS X doesn't tell you how many items are in the Recycle Bin or how much space they take up.

If you do not want the system to ask for confirmation every time to empty the trash, you can disable the request once and for all.

To do this, select File>Preferences, click Advanced, and uncheck Show warning before emptying the Trash.

Bottom: Get Info window for a Locked file. This method of protecting a file does not even approach military level - any random attacker can remove the protection from the file in the same way. But a protected file still causes an "operation cannot be completed" warning to appear when you try to put it in the Trash, providing at least one level of error protection.

Advice The latter method has two advantages. Firstly, you will not be bothered with the question Are you sure? (Are you sure?). If the user clicked on the Trash and then selected the Empty Trash command, then it's pretty clear that he really is confident. Secondly, this method sweeps out all Locked files without requiring them to be unlocked first.

If you choose either of the first two methods, Mac OS will ask you to confirm your decision.

Click OK. (Figure 2.11 shows the message and how to get rid of it.) Either way, Mac OS X will now delete these files from your hard drive.

Emptying Trash 2: Safely and Permanently

After emptying the recycle bin using the method described above, you can see that all the icons in it have disappeared. The reality, however, is that the data from all the files is still on the hard drive.

Yes, the space occupied by those who died untimely is now marked as available within the system, and over time, new saved files will be able to take it. But until that happens, some buyer of your Mac on eBay or a tech-savvy relative or work colleague can use a program like Date Rescue to recover deleted files. (In more serious cases, companies like DriveSavers.com can recover important information using sophisticated, specialized equipment—of course, this will cost you several hundred dollars.)

Not everyone is ready to accept this situation - for example, this applies to government agencies, spies and paranoids. For them, deleting a file must be done for real - finally, irrevocably and forever.

Mac OS X has a corresponding command for this - Secure Empty Trash. If you select this command from the Finder menu, the Mac does not simply erase the memory where the killed file was located. He writes new information to this place - zeros and ones in random order. Pure gobbledygook.

Of course, this procedure takes longer than the simple Empty Trash command. But if you are absolutely sure that the file should disappear forever (and that you will definitely never need it again), then the Secure Empty Trash procedure will reliably fulfill your desire.

Protected Files: Next Generation

By selecting a file or folder, selecting the File>Get Info command and checking the Locked checkbox, you will protect the corresponding file from accidental deletion (see Figure 2.11, below). A lock appears in the corner of the icon, which is also visible in Fig. 2.11.

Mac OS X will never let you move a protected icon to the Trash—or any other folder. You will also not be able to place the icon of a running program into the Trash.

If anything already in the Recycle Bin appears to be protected, click and hover over the Recycle Bin icon itself. If you now select Empty Trash from the shortcut menu that appears, Mac OS X will empty the Trash (and protected files and everything else) without warning.

Of course, there is an alternative - to remove protection from the contents of the Recycle Bin. Luckily, there is a quick way to do this. Click the Recycle Bin icon to open its window, then select the icons you want to unprotect (or choose Edit>Select All).

Press Option--I (or choose File>Show Inspector while holding down the Option key). Clear the Locked checkbox.

ROUGH DIAMOND
Opening objects in the Trash
Sometimes it is very useful to check what kind of document is in the Recycle Bin before consigning it to oblivion - and this can only be done by opening it.

The difficulty is that you won't be able to open it by double-clicking it; you'll only get an error message.

At least that's what Apple is trying to convince you of.

But, of course, there is a way out, and more than one. First, you can try using Quick Look (page 74).

Secondly, if this fails - or you want to not only read the file, but also edit it - you can drag the document onto the icon of the program that can open it. That is, if the file Don’t Read Me.txt is in the Trash, you can drag it to the Word or TextEdit icon in your Dock.

The document will obediently open on the screen. Examine it, close and empty the Trash (or restore the document).

(Yes, you can protect or unprotect a group of files at once.) Now you can send your newly unprotected files to digital heaven without any fuss. (If you're still having trouble emptying the Recycle Bin, see Chapter 17 for some useful UNIX commands.)

It's a rare Mac user who hasn't encountered a problem with emptying the Recycle Bin. This seemingly simple operation can turn into a living hell - as a result of deleting unnecessary files, the computer may hesitate for a long time or even reboot, after which something usually gets “stuck” in the trash and does not want to be deleted anywhere else. That's why it's useful to know that the solution to any problems with the Recycle Bin in OS X is a simple console command.

It is recommended that you start using the console command described below regularly - it can significantly improve your experience with your Mac. Especially if you are used to working with a large number of files that you have to delete every day. No more agonizing waits, fear of a sudden reboot and throwing files into the trash in separate portions.

Step 1: Launch the application Terminal(the fastest way to access it is through Spotlight search)

Step 2: Type the following command at the command prompt and press Enter:

Step 3. Confirm the action by entering the password in the Terminal and pressing Enter again. Note: The password will not be displayed as you enter it

Step 4. Check your cart

That's all! Your Recycle Bin will be cleared of all files contained in it, including those stuck from previous unsuccessful emptyings. If there were a lot of files in your trash, then you will immediately notice that the cleaning process happened many times faster than usual and there were no Mac freezes.

Deleting files on a computer is a routine procedure that each of us goes through every day. You select the files you need, and then either simply drag them or send them to the trash via the context menu. It would seem that what difficulties may arise here, but sometimes the system does not allow you to delete files or the recycle bin simply is not emptied. What to do in such cases?

First, you need to make sure that your account has administrator rights. Some system files are not allowed to be deleted by ordinary users, and the computer administrator may have prohibited the deletion of certain files on the computer. You can check user rights in System Preferences > Users and Groups.


Second, if a file is moved to the Recycle Bin, but when you try to empty the Recycle Bin, you receive the message "The operation cannot be performed because the object 'filename' is locked," try emptying the Recycle Bin as follows: Open Finder > From the top control panel, select Finder > " Empty Trash > press the Option key and Empty Trash.

If this does not help, then you need to make sure that the file you are trying to delete is not locked. To do this, select the problematic file, right-click, select “Properties” > “Protection”. If there is a checkmark next to the item, uncheck it.

If there are several protected files in the Recycle Bin, then in order not to remove protection from each of them manually, you can use a terminal command that will remove protection from all files at once.

Open the Terminal application and the Trash application, so that the application windows are side by side. Copy the command chflags -R nouchg into the terminal, but do not enter it. After nouchg you must put a space. Next, simply select and transfer all files from the Recycle Bin to the terminal window. Press Enter.

Another possible reason is an incorrect file name. If the name uses special ASCII characters (quotes, dashes, asterisks), this may cause errors in macOS. Rename the file and try deleting it again.

Also, make sure that no running application is using the file you are trying to delete.

If none of the tips helped, then check the file system of your computer disks for errors. To do this, open Disk Utility > First Aid.

Mac OS X is stuck on a file or folder and refuses to delete it? If you are unable to empty the Recycle Bin, use our guide on how to delete such files.

As a Mac user, you have probably encountered this situation when emptying the Recycle Bin, when instead of emptying the Recycle Bin, the message “You do not have enough rights” or “Error -8003” constantly pops up. In many cases (but not all), the problematic files are located on an external volume or drive. Most often this is a consequence of manually deleting Time Machine backups through Finder. It also happens that files on the boot disk are used by running applications and cannot be deleted. There is no shortage of options here.

Unfortunately, there is no single solution for this problem. Starting with simple techniques, we will gradually reach the most desperate methods, which are used in very severe cases. Eventually you will find a solution to the problem. Good luck!

Reboot and force empty trash

It's amazing how many computer glitches can be fixed by simply rebooting your computer. So, naturally, that's where we'll start. After rebooting, click on the Trash icon to open it in Finder. Hold Option while clicking the Clear button. Still nothing? Select “Empty Trash Permanently” from the Finder menu.

Unlocking and renaming files

The operation can't be completed because the file or folder is locked? The first thing to do is look at where the problematic file(s) or folder(s) are located. Do they have weird names? Remove unusual characters (especially slashes) and try emptying the Trash again. If this doesn't help, right-click on the stubborn file/folder and select Properties. If the “Protection” checkbox is checked, uncheck it and close the properties window. Try the “Clear” button again.

Third Party Applications

While installing third-party applications is not an ideal solution to such problems on Mac OS X, this method is much easier (and safer) than the next two. So before you go any further, take advantage of it. Download the Trash It app! or Cocktail. Hope you stop at this step.

Disk recovery and access rights restoration

Sometimes files are damaged and need additional procedure before deletion. Insert the Mac OS X installation disc and boot your Mac while holding down the C key. Once the disc boots, launch Disk Utility from the Setup or Utilities menu (depending on your version of Mac OS X). Click on the hard drive on the left, then the First Aid tab, and finally the “Repair Disk” button. If after recovery there are no errors in the list, click “Repair disk” again.

Now click on the “Restore access rights” button. This only needs to be done once. Repeat the disk recovery procedure and restore access rights for all external volumes and disks in the Disk Utility list. When you're done, restart your Mac and try force emptying the Trash (described above).

Emptying the Trash via Terminal

Now we are ready for a dangerous (but apparently necessary) method. I must warn you that executing this command in the Terminal will easily deprive you of all data if you do not strictly follow the instructions. It's a good idea to back up all your data at this step. Launch Terminal, which is located in the Applications -> Utilities folder and enter the following command.

sudo rm -rf ~/.Trash/

This command is run as the Root user (the “sudo” part) and deletes all data from the Trash folder of the current account. Click Enter/Return to execute. Enter the administrator password in the window and press Enter/Return again. You will not see any reaction in the Terminal. When finished, type exit and click Enter/Return to exit the Terminal.

Conclusion

Is your cart now empty? I really hope so! If you went through all the steps in the guide and did not get results, then perhaps you have become a victim of a specific problem that requires a special approach. Describe your situation in the comments. Perhaps someone from the Mac community can help you.

The Recycle Bin in OS X is one of those things that few people think about seriously. We simply delete files or drag them to the Trash icon in the dock. Then we empty the Recycle Bin to free up disk space... and that's it. But in fact, there are several ways to delete files and clean them, and they are much more convenient than those known to you. Want to delete files and empty the trash using keyboard shortcuts? Nothing could be easier!

Move to cart

What do we do when we want to delete an unnecessary file? Right-click and select “Move to Trash” or drag the file onto the Trash icon in the dock. Instead of these tedious steps, you can simply press ⌘⌫ on the keyboard - and the selected file will instantly be sent to the Trash. Incredibly simple!

Restoring a file from the Recycle Bin

You will be surprised, but to return deleted files to their original location, you need to click... yes, that same ⌘⌫! Select the files you want to restore and press ⌘⌫ - the files will be restored and you will be able to work with them. Not so obvious at first glance, but also simple and convenient!

Emptying the Trash

This is a routine operation that we have to periodically perform to free up disk space (especially important for Air owners) and maintain order. Typically, we do this by right-clicking on the icon in the Dock and clicking “Empty Trash”. But, as you may have guessed, there is a simpler and more convenient way. In the Finder, you need to tell Volsh to press ⇧⌘⌫ and your Trash will be completely empty. This is a safe deletion method because the system will display a standard confirmation dialog before deleting.

Empty the Trash immediately

If you are adamant in your intentions to delete all files from the Recycle Bin, immediately press ⇧⌥⌘⌫. There is absolutely no point in wasting your precious time on stupid confirmations. No sooner said than done!

These are simple but very useful shortcuts that I hope will be useful to you in your daily work using your Mac. I think almost everyone knew about ⌘⌫, but what about the rest? Tell us in the comments.