5

I am unable to determine the path to the Bin directory, the one that is shown in Finder window when I click on The Trash icon in the Dock.

I am seeking it, so I can either use the Finder's Go to Folder... or Terminal's open command to directly open the Bin folder in Finder.

bmike
  • 235,889
Nimesh Neema
  • 51,809
  • 2
    It's not a single path, it's a kind of Smart Folder, it's per user & also one for each non-boot drive iirc ~/.Trash finds your local folder – Tetsujin Aug 05 '21 at 10:28
  • 1
    See https://apple.stackexchange.com/questions/335092/trash-directories-on-mac-how-to-find-them-and-how-to-properly-clear-them – Tetsujin Aug 05 '21 at 10:29
  • The terminal command set will give you the information for the path of bin(s) directory(ies). –  Aug 05 '21 at 10:36
  • Other than the trivial case of files that used to be in your user folder and now are “trashed” or “binned”, this depends on which os version you use. What are you trying to accomplish? – bmike Aug 05 '21 at 11:06
  • @bmike I am trying to access the Bin directory in Finder using the Go to Folder Finder command. – Nimesh Neema Aug 05 '21 at 11:08
  • 1
    There is not one bin, so “the bin” is not a thing but many. – bmike Aug 05 '21 at 11:18
  • Please consider improving your question by explaining why you want to do this. What advantage does it give you over clicking on the dock icon? What is the end result you want to accomplish by using the Go to Folder command or the Terminal to open the Trash window in the Finder? – Elhem Enohpi Aug 05 '21 at 14:25
  • 2
    It would probably be wise to avoid calling it a ‘bin’ folder, even in UK English, because in Unix-like operating systems such as macOS, ‘bin’ is the name of several directories where low-level programs — traditionally called ‘binaries’ — are stored: /bin, /usr/bin, /usr/local/bin, etc. – gidds Aug 05 '21 at 21:07

2 Answers2

5

Each user gets their own bin on each volume that’s attached, so your assumption that path stores all files visible in the “bin” or “trash” isn’t technically true. The implementation of trash(es) folders is covered on older OS here.

The most common case is a “soft deleted” home folder file, so to access that bin, do this:

cd ~/.Trash/

Worse, localization comes into play (trash, bin, basura) so this is a delightfully complicated “simple” question.

bmike
  • 235,889
5

If your goal is to "directly open the Bin [a.k.a. Trash] folder in Finder" from Terminal, you may use this command to open the special combined trashes window:

osascript -e 'tell application "Finder" to open trash'

Presumably you should change "trash" to "bin" if your system uses that.

  • 1
    Astounding - yet another correct way to parse this “simple” request using the command line. This does open the bin in Finder. – bmike Aug 05 '21 at 13:43