Quote:
Originally Posted by MadeInGermany
find -exec safely handles special file names like "two words.txt"
Code:
find ~/dir0 -type f -exec grep -qi hello {} \; -exec ln -t ~/hellofilesfromdir0 {} +
Further cp is replaced by an efficient ln (that increases the link count but only works within the file system; otherwise consider symlinks aka ln -s).
|
Your command works. Thank you.
When grep output is silent, where does its result go in the shell?
What shell symbol(s) hold those grep outputs?
I am not able to parse this:
Code:
-exec ln -t ~/hellofilesfromdir0 {} +
The braces in last exec command, {}, seems to imply it is
a placeholder for output of grep.
I did not know {} is a catch all for silent grep output. Or is it?
I am not able to find information in bash on this form of usage.
Then there is the plus, +, symbol at the end.
How does {} + interact?
What man page has this information?
Man bash does not explain much about exec.
Thank you.