I want to move lines matching certain pattern from file1 to file2. Analogous to operation cut and paste from one file to another in windows
You can use perl and select a different filehandle based in a match of a regular expression when printing:
perl -i.bak -ne 'BEGIN { open $oh, q|>|, pop or die } { print { m/bar/ ? $oh : q|ARGVOUT| } $_ }' file1 file2
It yields:
==> file1 <==
bla foo bla
bla aaa bla
bla foo bla
==> file2 <==
bla bar bla
bla bar bla