ls is a bash builtin. You can probably invoke the ls command with /bin/ls.
But also, passing ">" as an argument to exec.Command doesn't do what
you want. > is a redirection for a shell and exec.Command is not a
shell.
I'm not sure what you're trying to accomplish, but here are two things
you could do that may be helpful:
(1) If you just do exec.Command("ls"), cmd.Stdout is automatically
discarded (like doing '> /dev/null' in your shell). See the docs for
exec.Cmd.Stdout:
// If either is nil, Run connects the corresponding file descriptor
// to the null device (os.DevNull).
(2) If you want to invoke a shell, you can do something like
exec.Command("/bin/bash", "-c", "ls > /dev/null"). (I'm not sure what
the point of that particular invocation would be, though.)