I am trying to use scp to copy large log files from a remote server. However I want only the lines in remote log file that has a string "Fail". This is how I am doing it currently
scp user@ip:remote_folder/logfile* /localfolder
This copies all the files starting with logfile in remote server to my local folder. The files are pretty large and I need to copy only the lines in those log file, containing the string "Fail" from remote server. Can any body tell me how to do this? Can I use cat or grep command?
-C
flag tossh
/scp
to enable compression can make things much faster over a slow connection... – thkala