Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Suppose some file "Any File.pdf" is in the Trash (aka ~/.Trash).

How can I determine its original location?

By "original location" I mean the folder where that file would be moved to if one were to apply the "Put Back" command to it (but without actually doing so)? (See figure below.)

(I had hoped that this information would be available through running "Get Info" on the file, but I did not find it there.)

Put Back

share|improve this question
2  
As mentioned here (last comment) this information seems to be stored in the .DS_Store file in the trash-folder –  iolsmit May 29 '12 at 14:04
4  
Related: superuser.com/questions/59376/… –  Ian C. May 29 '12 at 14:07

2 Answers 2

up vote 2 down vote accepted

Data containing a file's original location before being placed in the Trash is keep in the .DS_Store file in the ~/.Trash folder.

Since the trash folder is hidden it can not normally be found using the finder application. The easiest way to find this file is by using the Terminal and entering the following commands.

$cd ~/.Trash
$open -e .DS_Store

This will open the file in TextEdit. From there you should be able to quickly search for the file by its name and its original path.

Its seems that files in .DS_Store follow the pattern of:

FILE_NAME ptbLustr ORIGINAL_PATH_TO_FILE

Note spaces are added just for readability.

share|improve this answer
1  
Did you actually test that? .DS_Store contains a lot of binary data, I didn't find any file names at all. –  patrix Jun 4 '12 at 15:23
    
I did test this on my own machine before posting. I found references to files in my Trash and their original locations. –  a240 Jun 4 '12 at 15:28
    
Ah, seems to depend on the language settings, it's all Unicode here. –  patrix Jun 4 '12 at 16:25

'Put Back' the File, Use the search function to search for the file, When you find your file, Right-Click it and select "Open Enclosing Folder"

share|improve this answer
2  
What if the same file name appears more than once on the file system? This approach will fail for that case. Better to read the meta data OS X is reading to determine the 'Put Back' location in the first place. –  Ian C. May 29 '12 at 14:21
1  
I thought I was very explicit about wanting a solution that did not require actually putting back the file. How much clearer could I have made it??? –  kjo May 29 '12 at 15:21
    
@kjo For other people who search for this question that might be the solution though. –  Lri May 29 '12 at 16:41
3  
@Lri: if so, he/she should have submitted a comment, not an answer. It is unfair and disrespectful to the OP who takes pains to write a clear question not to answer what was asked. It also gives to the casual observer the wrong impression that the question has already been answered, thus reducing the likelihood that the question the OP took pains to clearly state will actually get an answer. If SE wants that those who post do a good job with the wording of their questions, then it should also hold the responders to the minimal courtesy of answering what is asked. –  kjo May 29 '12 at 17:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.