What does the following means ?
find myDirectory -name myFile -exec ls \-ln {} \;
I’ve looked here but didn’t understand exactly
-exec command True if the executed command returns a zero value as exit status. The end of command must be punctuated by an escaped semicolon. A command argument {} is replaced by the current path name.
This part -exec ls \-ln {} \; is not clear to me .
Regards
That means: find all files with a name
myFilein the current directory and all its subdirectories and for every file that was found runls -lnwith the name of the file.For example:
In this case
findwill runlstwice:Every time it will expand
{}as the fullname of the found file.Also I must add that you need the backslash before -ln in this case. Yes, you can use it, but it is absolutely useless here.