Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash 如何使用ssh然后运行命令?_Bash - Fatal编程技术网

Bash 如何使用ssh然后运行命令?

Bash 如何使用ssh然后运行命令?,bash,Bash,如何通过ssh连接到服务器,然后递归地获取目录中文件最近修改的时间?您必须引用该命令。或者,您可以使用使用引号: ssh-i dummy.pemubuntu@server'find/home/ubuntu/-type f-print0 | xargs-0 stat--格式“%Z”|排序-nr |剪切-d:-f2-|头-1” ssh -i dummy.pem ubuntu@server find /home/ubuntu/ -type f -print0 | xargs -0 stat --fo

如何通过ssh连接到服务器,然后递归地获取目录中文件最近修改的时间?

您必须引用该命令。或者,您可以使用
使用引号:
ssh-i dummy.pemubuntu@server'find/home/ubuntu/-type f-print0 |
xargs-0 stat--格式“%Z”|排序-nr |剪切-d:-f2-|头-1”

ssh -i dummy.pem ubuntu@server find /home/ubuntu/ -type f -print0 | 
xargs -0 stat --format '%Z' | sort -nr | cut -d: -f2- | head -1

stat: missing operand
Try `stat --help' for more information.
ssh -i ... <<EOF
find /home...
EOF