无法在 Mac 的 Zsh 中找到文件夹中已存在一分钟的文件

发布于 2024-07-18 03:05:18 字数 225 浏览 2 评论 0原文

我需要找到在文件夹“废纸篓”中恰好一分钟的文件。 这些文件已在我的计算机上移动到该文件夹​​中。

我运行以下命令失败,

find -atime n1m .

我通过命令获取了目录中的所有文件,甚至是我刚刚创建的文件。 看来选项 -atime 不正确。

如何找到访问时间为一分钟的文件?

I need to find files which have been in the folder Wastebasket exactly one minute.
The files have been moved all over my computer to the folder.

I run the following unsuccessfully

find -atime n1m .

I get all my files in the directory by the command, even ones which I just created.
It seems that the option -atime is not correct.

How can you find files which access time is one minute?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

三生一梦 2024-07-25 03:05:19

我认为您正在寻找

find -amin 1

n 只是一个用数字替换的变量。

+n 例如 +1 表示更大
n 例如1 表示完全
-n 例如-1表示小于

I think you're looking for

find -amin 1

n is just a variable that you replace with a number.

+n eg +1 means greater
n eg 1 means exactly
-n eg -1 means less than

奈何桥上唱咆哮 2024-07-25 03:05:19

删除n。 联机帮助页中的 n 代表数字。

find -atime 1m .

Drop the n. The n in the manpage stands for a number.

find -atime 1m .
〆凄凉。 2024-07-25 03:05:19

既然您提到您正在使用 zsh,我不妨建议一个特定于 zsh 的答案。 要查找访问时间为一分钟或更短时间的所有文件,可以使用以下命令:

gt; ls *(.am-1)

Since you've mentioned you're using zsh, I might as well suggest a zsh-specific answer. To find all files with access time of minute or less ago, you can use the command:

gt; ls *(.am-1)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文