0

There's already another question about this that has the following answer:

find . -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "

But I get the following error when I run this on Solaris

find: bad option -printf
find: [-H | -L] path-list predicate-list

And here's what I get when I run uname -a

SunOS <SERVER NAME HERE> 5.10 Generic_150400-59 sun4u sparc SUNW,SPARC-Enterprise

Does anyone know the Solaris Equivalent? Please and Thank You!

Please and Thank You!

  • What's wrong this [this answer](https://stackoverflow.com/a/18641147/4756299) on the question you linked? – Andrew Henle Aug 21 '18 at 15:25
  • Possible duplicate of [How to recursively find the latest modified file in a directory?](https://stackoverflow.com/questions/4561895/how-to-recursively-find-the-latest-modified-file-in-a-directory) – Andrew Henle Aug 22 '18 at 09:31

1 Answers1

0

"find" in Solaris doesn't have "-printf" option.

But you can do the following.

find . -type f -exec /bin/ls -E {} \; | sort -k6,7 | tail -1

Then, you can see somthing like this.

rw-r--r--   1 root     other          109 2018-09-13 00:37:39.295187000 +0900 ./newest.txt
Dr.K
  • 31
  • 4