I have a command which list outs events of "Magento 2", which is working fine in the terminal.
I want it's output to be printed into a file but none of the below code works:
find . -type f -exec grep -n -H -A 2 -T "eventManager->dispatch(" {} \ | tee ~/MAGE2EVENTS.txt
Neither this one:
find . -type f -exec grep -n -H -A 2 -T "eventManager->dispatch(" {} \ >> ~/MAGE2EVENTS.txt
I see 'exec' has been used in this code which shows error:
find: missing argument to `-exec'
So how to print the terminal output of this command to file ?