package main import ( "fmt" "os/exec" ) func main() { // NOTE: mycmd will contain a byte array, not string output mycmd, _ := exec.Command("ls", "-lGa", "/").Output() // Convert mycmd byte array to string, and print to terminal fmt.Println(string(mycmd)) }