System Trash path

What is the path to the system wide Trash folder?
I have 2 internal disks and depending on where the file is originally, the path to it is different, for example:
/Users/dannywyatt/.Trash/SCR-20240102-nqnk.png
/Volumes/Secondary/.Trashes/501/SCR-20240101-jxjn.png

Then if I click the Trash icon on the dock, I see this, which includes all trashed files from both disks:
image

So basically it seems that there's a system wise Trash where all trashed files are.
For example if I go to my main disk's Trash I get this:
image

If I go to the secondary disk's Trash I get this:
image
and the file SCR-20240102-nqnk.png which was deleted from my main disk, is not on the secondary disk's Trash.

I'm building a macro that will move all deleted files/folders to the Secondary disk.
I could include 2 actions to first move files from one Trash, then the other, but I'm wondering if I can use the main Trash's path instead?

Looks like ~/.Trash/, but you may want to confirm on your system.

I found out by opening my Trash, selecting an item, and then using Cmd+Option+C, which copies the path of the currently selected Finder item.

If that doesn't work (I don't know if that's a setting of mine), you could also right click on a folder in the Trash and open using 'New Terminal at Folder' and then run pwd in Terminal.

That path takes you to the user's trash, that I shared as my first path (users/dannywyatt). But the other path I shared (trashes/501) is for files deleted from my secondary internal disk. iCloud has its own trash as well.
So for example if you click the trash icon in the dock you get to the trash where ALL files are stored, but if you have a file in iCloud and trash it and then go to ~/.Trash the file won't be there, only if you click the trash icon in the dock. The same for a file I trash from my secondary disk.

I worked on a macro and I noticed that I had to include 3 different trash paths to get all files to move

Only guessing here now: But might it be that the trash in the dock performs kind of like a smart folder, and therefore might not have a path of its own? Your observations makes it sound a little like that might be the case

1 Like

Yes that is a good guess. Maybe that's what it is.