var sidebar_align = 'right';
var content_container_margin = parseInt('350px');
var sidebar_width = parseInt('330px');
save grep to txt file?
I grepped an IP address on a domain log and it showed thousands of lines. How do I save this grep result to a txt file so I can send it to someone?
I belive its
grep (put your options) >> filename.txt
grep <options> search_term file > file_to_save.txt
Or, use >> to append to a file.
Adding a "> filename.txt" will write the file to filename.txt, completely overwriting whatever was already there.
">> filename.txt" will add it to the end of the file.
This can be done with (most) anything on the command line that produces output (and isn't interactive): "uptime >> uptime.txt" or "lsof >> something.txt" works too.
A nice trick is once you have sent the output to a textfile do this:
cat file.txt | grep -v stuffyoudontwant > file.txt
This can help you start removing lines you dont want to drill down to what you do.
Jordan Jacobs | VP, Products|SingleHop| JJ @SingleHop.com
Managed Dedicated Servers | Bare-Metal Servers | Cloud Services