local f = io.popen("ls -l") -- runs command local buf = f:read("*a") -- read output of command f:close() print(buf)