1、ssh root@ip "command"即可执行远程命令
2、实例
#!/bin/sh
ACCT_CYCLE=abc
ip_list=$HOME/shell/all_hosts_2
dst_dir=$HOME/Data/dbc/$ACCT_CYCLE/dat/admin/
for ip in `cat ${ip_list}`; do
echo ${ip};
count_rst=`ssh root@${ip} "find $dst_dir -type f |wc -l"`;
echo $count_rst;
done