{"id":462,"date":"2009-10-17T14:01:48","date_gmt":"2009-10-17T12:01:48","guid":{"rendered":"http:\/\/www.kill-9.it\/blog\/?p=462"},"modified":"2009-10-17T14:01:48","modified_gmt":"2009-10-17T12:01:48","slug":"verbosely-emptying-the-trash","status":"publish","type":"post","link":"https:\/\/www.kill-9.it\/blog\/index.php\/2009\/10\/17\/verbosely-emptying-the-trash\/","title":{"rendered":"Verbosely emptying the trash"},"content":{"rendered":"<p>Like it happens on Windows, when you decide to delete something OSX simply moves that file or directory to &#8220;the Trash&#8221;, which is just a hidden directory on the volume you&#8217;re deleting from. Then, you right click on the Trash icon and select &#8220;Empty trash&#8221;.<br \/>\nThis action pops up a small window like this:<\/p>\n<p align=center>\n<img decoding=\"async\" src=\"http:\/\/www.kill-9.it\/images\/osxtrash.png\" alt=\"osx trash progress window\" \/>\n<\/p>\n<p>I grew tired of asking myself what OSX was deleting (the operation can take a while, especially when &#8212; as I often do &#8212; you&#8217;re doing a secure erase) so this ugly one-liner, run as root, will give you the file the OS is working on:<\/p>\n<p><code><br \/>\nps auxw | grep -i locum | grep -v grep | awk &#039;{print $2}&#039; | xargs lsof -p | grep -i Trash | awk &#039;{print $9}&#039;<br \/>\n<\/code><\/p>\n<p>It will output something like this:<br \/>\n<code>\/Volumes\/FAT80GB\/.Trashes\/502\/xcode3210a432.dmg<\/code><\/p>\n<p>You can wrap that command inside the usual while\/sleep loop if you want something that keeps you updated on what is going on &#8212; or make it an alias for your favourite shell.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Like it happens on Windows, when you decide to delete something OSX simply moves that file or directory to &#8220;the Trash&#8221;, which is just a hidden directory on the volume you&#8217;re deleting from. Then, you right click on the Trash icon and select &#8220;Empty trash&#8221;. This action pops up a small window like this: I &hellip; <a href=\"https:\/\/www.kill-9.it\/blog\/index.php\/2009\/10\/17\/verbosely-emptying-the-trash\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Verbosely emptying the trash&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,6,3],"tags":[],"class_list":["post-462","post","type-post","status-publish","format-standard","hentry","category-apple","category-english","category-geek"],"_links":{"self":[{"href":"https:\/\/www.kill-9.it\/blog\/index.php\/wp-json\/wp\/v2\/posts\/462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kill-9.it\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kill-9.it\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kill-9.it\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kill-9.it\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=462"}],"version-history":[{"count":7,"href":"https:\/\/www.kill-9.it\/blog\/index.php\/wp-json\/wp\/v2\/posts\/462\/revisions"}],"predecessor-version":[{"id":469,"href":"https:\/\/www.kill-9.it\/blog\/index.php\/wp-json\/wp\/v2\/posts\/462\/revisions\/469"}],"wp:attachment":[{"href":"https:\/\/www.kill-9.it\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kill-9.it\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kill-9.it\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}