在 find 命令中,“{} +” 的作用是什么?最后是什么意思?

发布于 2024-11-17 02:20:51 字数 242 浏览 2 评论 0原文

find -L / -samefile /path/to/file -exec ls -ld {} +

{} + 是什么意思?

示例来自 CommandLineFu

find -L / -samefile /path/to/file -exec ls -ld {} +

What does the {} + mean?

Example from CommandLineFu

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

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

发布评论

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

评论(2

草莓味的萝莉 2024-11-24 02:20:51

这是 find 命令语法的一部分。当为 find 指定在每次匹配时执行的子命令时,必须将 {} 插入到参数列表中,以指示 find 应将路径名放置在何处当前文件的。子命令以分号(加引号以避免被 shell 解析)或加号终止,后者指示 find 应将 {} 替换为尽可能多的内容尽可能一次指定路径名,而不是 ; 一次只指定一个路径名。

That's part of the syntax of the find command. When giving find a subcommand to execute on each match, a {} must be inserted into the argument list to indicate where find should place the pathname of the current file. The subcommand is terminated by either a semicolon (quoted to avoid parsing by the shell) or by a plus sign, the latter indicating that find should replace the {} with as many pathnames at once as possible, in contrast to just one at a time for ;.

对不⑦ 2024-11-24 02:20:51

这是 find-exec 选项的一部分; {} 扩展为当前文件名,+(不可移植;应为 \;';'或类似)表示命令参数的结束。

That's part of the -exec option to find; {} expands to the current file name, and + (nonportably; should be \; or ';' or similar) indicates the end of the command arguments.

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