Please help urgently!!
Need unix query-
I want to search pattern "abc" in a folder /home/rahul and want to copy all the files that contain this pattern to a new location /home/rahul2 .
Please help urgently!!
Need unix query-
I want to search pattern "abc" in a folder /home/rahul and want to copy all the files that contain this pattern to a new location /home/rahul2 .
This isn't the right forum for urgent requests!
Your request is also vague. Do you want to move files whose names contain the string "abc" or do you want to move files that contain the string "abc" as text inside the file?
Hi Don ,
Thanks for the reply .
I want to move files that contain the string "abc" as text inside the files.
Assuming that there aren't any whitespace characters in your file names, try:
cd /home/rahul
mv $(grep -l abc *) /home/rahul2