This question already has an answer here:
I want to run the following bash command using golang's exec.Command()
ls > sample.txt
For this I write
But this doesn't seem to work. I know I can write to a file by using
But I want to write sepcifically in that manner. Any idea how I can do it in golang?