# How to Find the Latest Version of a File on OSX Using mdfind

DevFeed: [How to Find the Latest Version of a File on OSX Using mdfind](<https://devfeed.tech/articles/how-to-find-the-latest-version-of-a-file-on-osx-using-mdfind-28210.md>)

Original publisher: [Read original article](<http://fuzzyblog.io/blog/osx/2020/04/26/how-to-find-the-latest-version-of-a-file-on-osx-using-mdfind.html>)

Author: Fuzzygroup

Published: 2020-04-26T00:00:00Z

Content type: tutorial

Language: en

Sources: [Scott Johnson](<https://devfeed.tech/sources/scott-johnson.md>)

Topics: [macOS](<https://devfeed.tech/topics/macos.md>), [versioning](<https://devfeed.tech/topics/versioning.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [ls](<https://devfeed.tech/tags/ls.md>), [mdfind](<https://devfeed.tech/tags/mdfind.md>), [osx](<https://devfeed.tech/tags/osx.md>)

## AI overview

To find copies of `select_page_parser.rb` on macOS, the author uses `mdfind -name select_page_parser.rb`. They pipe its null-delimited results through `xargs -0 ls -t`, which lists the matching files sorted by modification time, newest first. The excerpt does not show how to select or verify the latest copy.

## Source excerpt

"""< HEAD ======= 4cbbc577cf49ce99e5aaf8b73f0396e50651d3a9 I recently wanted to find the latest version of a library I wrote and I started by using mdfind: mdfind -name select_page_parser.rb I then added xargs per this article: mdfind -name select_page_parser.rb -0 | xargs -0 ls -t