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.
精彩评论