There was a file with the following text:foo bar bazbar foo bazbaz foo barbar baz foofoo baz barbaz bar foo
I needed to get the 1st one 'foo bar baz' and the 5th one 'foo baz bar' as the output to the console.
Hence I tried the command ^foo.*
But the output is not coming as expected. I tried the same thing inside the Ubuntu terminal installed in the virtual box and it is appropriately functioning there.
Two Images are attached:Run in WSL UbuntuRun in Virtual Box Ubuntu