Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unix 如何在目录中递归查找最新修改的文件(在Solaris中)?_Unix_Recursion_Find_Solaris_Sunos - Fatal编程技术网

Unix 如何在目录中递归查找最新修改的文件(在Solaris中)?

Unix 如何在目录中递归查找最新修改的文件(在Solaris中)?,unix,recursion,find,solaris,sunos,Unix,Recursion,Find,Solaris,Sunos,关于这一点,已经有以下答案: find . -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" " 但是,当我在Solaris上运行此操作时,会出现以下错误 find: bad option -printf find: [-H | -L] path-list predicate-list 下面是我运行uname-a SunOS <SERVER NAME HERE> 5.10 Generic_150400-59

关于这一点,已经有以下答案:

find . -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "
但是,当我在Solaris上运行此操作时,会出现以下错误

find: bad option -printf
find: [-H | -L] path-list predicate-list
下面是我运行
uname-a

SunOS <SERVER NAME HERE> 5.10 Generic_150400-59 sun4u sparc SUNW,SPARC-Enterprise
SunOS 5.10通用_150400-59 sun4u sparc SUNW,sparc Enterprise
有人知道Solaris的等价物吗?请,谢谢

请,谢谢

Solaris中的“查找”没有“-printf”选项

但你可以做到以下几点

find . -type f -exec /bin/ls -E {} \; | sort -k6,7 | tail -1
然后,你可以看到这样的事情

rw-r--r--   1 root     other          109 2018-09-13 00:37:39.295187000 +0900 ./newest.txt
你链接的问题出了什么问题?可能是重复的