![]() |
grep stdout to file and stderr to another file
I want output to go to one file and errors to go to another file. This works, however as the command stands right now, it doesn't return to the command line when terminated. thanks.
grep -r -n 'this*' /* >output.txt 2>errors.txt |
When terminated or when complete? It seems to work ok for me. Are you sure you want the /* and not ./*?
|
Hello,
May be you can try this one grep -r -n 1>output.txt 2>errors.txt Regards, maniannam |
Quote:
|
Doing a recursive grep on the ENTIRE filesystem will take a long time...are you sure it isn't still running when you're hitting Ctrl+C? Try running it on a small directory with only a few files and see what happens.
|
All that, and grepping certain "files" seems to never return. I'd recommend
a slightly different approach. find / -type f | xargs -i grep -n 'this*' /* >output.txt 2>errors.txt Cheers, Tink |
Quote:
Thanks for your help. And you too maniannam. I'll look into using xargs as well. |
Quote:
you from grepping character devices, kernel RAM and other funky things from which grep may not return ;} Cheers, Tink |
All times are GMT -5. The time now is 09:32 AM. |