执行系统 shell 命令示例:
fileDir := "files/"
out, err := exec.Command("sh", "-c", "ls -alh " + fileDir).Output() if err != nil { panic("cmd error") } log.Println(string(out))
2022-06-28 12:51:58
执行系统 shell 命令示例:
fileDir := "files/"
out, err := exec.Command("sh", "-c", "ls -alh " + fileDir).Output() if err != nil { panic("cmd error") } log.Println(string(out))