开发者

In a find command, what does "{} +" at the end mean?

开发者 https://www.devze.com 2023-03-14 21:53 出处:网络
find -L / -samefile /path/to/file -exec ls -ld {} + What does the {} + mean? Example f开发者_JAVA百科rom CommandLineFuThat\'s part of the syntax of the find command.When giving find a subcommand to
find -L / -samefile /path/to/file -exec ls -ld {} +

What does the {} + mean?

Example f开发者_JAVA百科rom CommandLineFu


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 ;.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消