Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.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
Python 如何获取操作系统范围内最近打开的文件列表_Python_Macos_File_Unix_Recent File List - Fatal编程技术网

Python 如何获取操作系统范围内最近打开的文件列表

Python 如何获取操作系统范围内最近打开的文件列表,python,macos,file,unix,recent-file-list,Python,Macos,File,Unix,Recent File List,如何获取操作系统上最近打开/写入的文件列表 Mac OS过去在菜单中有“最近的文件”(尽管加载速度非常慢) 我想也许可以用locate的方式 在Python或bash中寻找快速方法。您可能需要使用ps、pstree、lsof、find、top命令来完成类似的操作。例如:对于pstree-hapncG | cut-d'、'-f2 | cut-d'-f1中的pid;do/usr/sbin/lsof-p$pid 2>/dev/null;完成|排序| uniq-c>somefile.txt。。。。或者l

如何获取操作系统上最近打开/写入的文件列表

Mac OS过去在菜单中有“最近的文件”(尽管加载速度非常慢)

我想也许可以用
locate
的方式


在Python或bash中寻找快速方法。

您可能需要使用ps、pstree、lsof、find、top命令来完成类似的操作。例如:对于
pstree-hapncG | cut-d'、'-f2 | cut-d'-f1中的pid;do/usr/sbin/lsof-p$pid 2>/dev/null;完成|排序| uniq-c>somefile.txt。。。。或者lsof | grep“\/.\/”您可能必须使用ps、pstree、lsof、find、top命令来执行类似操作。例如:对于
pstree-hapncG | cut-d'、'-f2 | cut-d'-f1中的pid;do/usr/sbin/lsof-p$pid 2>/dev/null;完成|排序| uniq-c>somefile.txt。。。。或lsof | grep“\/.\/”