如果你需要使用io.popen local openPop = assert(io.popen('/bin/ls -la', 'r')) local output = openPop:read('*all') openPop:close() print(output) -- > Prints the output of the command.