[Go] golang 执行 Linux 系统 command

通过llama.cpp与羊驼聊天的网页界面- 详解 Serge 的启动使用

 

执行系统 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

posted on 2020-09-19 19:23  ercom  阅读(551)  评论(0编辑  收藏  举报