执行系统 shell 命令示例:
fileDir := "files/"out, err := exec.Command("sh", "-c", "ls -alh " + fileDir).Output() if err != nil { panic("cmd error") } log.Println(string(out))
Link:https://www.cnblogs.com/farwish/p/13697256.html