{"id":49039,"date":"2025-08-26T14:58:29","date_gmt":"2025-08-26T18:58:29","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=49039"},"modified":"2025-09-25T16:42:54","modified_gmt":"2025-09-25T20:42:54","slug":"the-trash-command","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2025\/08\/26\/the-trash-command\/","title":{"rendered":"The &ldquo;trash&rdquo; Command"},"content":{"rendered":"<p><a href=\"https:\/\/esham.io\/2025\/08\/deriveddata\">Benjamin Esham<\/a>:<\/p>\n<blockquote cite=\"https:\/\/esham.io\/2025\/08\/deriveddata\">\n<p>Every iOS and Mac developer is familiar with the situation: Xcode has gotten itself wedged somehow and the only solution is to blow away the <tt>DerivedData<\/tt> folder in <tt>~\/Library\/Developer\/Xcode<\/tt>.<\/p>\n<p>[&#8230;]<\/p>\n<p>But <code>rm<\/code> needs to enumerate every file and directory within <tt>DerivedData<\/tt> in order to delete them. The more files there are, the longer this will take.<\/p>\n<p>It&rsquo;s faster to <strong>move the DerivedData folder to the Trash.<\/strong> You could do this from the Finder, but I prefer to install <a href=\"https:\/\/hasseg.org\/trash\/\">Ali Rantakari&rsquo;s <code>trash<\/code> utility<\/a>.<\/p>\n<\/blockquote>\n\n<p>macOS 14 added a built-in <tt>\/usr\/bin\/trash<\/tt> command.<\/p>\n\n<p><a href=\"https:\/\/mastodon.social\/@peternlewis\/115048383195456419\">Peter N Lewis<\/a>:<\/p>\n<blockquote cite=\"https:\/\/mastodon.social\/@peternlewis\/115048383195456419\">\n<p>The good: they added a unix <code>trash<\/code> command to macOS. Nice! The bad: The Finder completely wigs out when you use it - disappears a different folder from the parent folder, leaving the trashed folder showing. The Finder display is borked, if you close and reopen the window the window is correct and the command worked as expected.<\/p>\n<\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2022\/01\/29\/xcode-through-the-years\/\">Xcode Through the Years<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2021\/02\/04\/deleting-deriveddata-the-right-way\/\">Deleting DerivedData the Right Way<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2019\/03\/29\/reclaiming-disk-space-from-xcode\/\">Reclaiming Disk Space From Xcode<\/a><\/li>\n<\/ul>\n\n<p id=\"the-trash-command-update-2025-09-25\">Update (<a href=\"#the-trash-command-update-2025-09-25\">2025-09-25<\/a>): <a href=\"https:\/\/hachyderm.io\/@vitor\/115265213841252064\">V&iacute;tor<\/a>:<\/p>\n<blockquote cite=\"https:\/\/hachyderm.io\/@vitor\/115265213841252064\">\n<p>I just tested on Sonoma 14.6.1 and 14.8 virtual machines and can confirm that \/usr\/bin\/trash does <em>not<\/em> exist on Sonoma 14, as reported.<\/p>\n<\/blockquote>\n<p>The man page on Sequoia says it was added in Sonoma, but that appears to be incorrect. The Tahoe man page says it was added in Sequoia.<\/p>","protected":false},"excerpt":{"rendered":"<p>Benjamin Esham: Every iOS and Mac developer is familiar with the situation: Xcode has gotten itself wedged somehow and the only solution is to blow away the DerivedData folder in ~\/Library\/Developer\/Xcode. [&#8230;] But rm needs to enumerate every file and directory within DerivedData in order to delete them. The more files there are, the longer [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2025-08-26T18:58:32Z","apple_news_api_id":"3d17423b-640b-4850-8643-2a430d566ecb","apple_news_api_modified_at":"2025-09-25T20:42:57Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/APRdCO2QLSFCGQypDDVZuyw","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[131,458,30,2385,2598,71,2822,226],"class_list":["post-49039","post","type-post","status-publish","format-standard","hentry","category-technology","tag-bug","tag-finder","tag-mac","tag-macos-14-sonoma","tag-macos-15-sequoia","tag-programming","tag-trash","tag-xcode"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/49039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=49039"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/49039\/revisions"}],"predecessor-version":[{"id":49369,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/49039\/revisions\/49369"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=49039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=49039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=49039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}