4

How can I display contents of trash using terminal?

1
  • You had two questions in here. This site works better when there is only one question per question. That way, it's easier for other people to find solutions if they have the same problem. I've edited out your second question. As AskDifferent is focused on end-user problems, it would be off-topic here anyway (StackOverflow.com might be the better place for that).
    – nohillside
    Jul 22 '15 at 9:56
7

You can run

ls -al ~/.Trash

to show the content of the Trash of the current user.

To see the content of all Trashes, use

sudo ls -al /Users/*/.Trash

from an admin account.

And if you also want to include the content of the Trash on external volumes, use

sudo sh -c 'ls -al /Volumes/*/.Trashes/*/'
1
  • Ahh, of course, the second * gets expanded too early, thanks. Fixed.
    – nohillside
    Jul 22 '15 at 12:36
4

Your Trash is a unison of the directory ~/.Trash and the .Trashes directory on any other mounted file systems. To view the contents of the GUI Trash in your shell

    ls ~/.Trash /Volumes/*/.Trashes/$(id -u) 2>/dev/null

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .