I have to copy from the current directory to a destination folder all the .txt files that contain a string given as parameter.
To find and display these files I used the code:
mkdir $1
for i in '*.txt'
do
grep -r -l $2 > lines.log
done
But how can I copy these files?