不ssh到远程主机 ,判断远程主机判断是否有 /home/abcstore/jq-linux64 文件
时间: 2023-12-22 12:06:14 浏览: 45
如果不ssh到远程主机,可以使用ssh命令的扩展功能,如下所示:
```bash
ssh user@remote_host 'if [ -f /home/abcstore/jq-linux64 ]; then echo "File exists"; else echo "File does not exist"; fi'
```
其中,user是远程主机的用户名,remote_host是远程主机的IP地址或域名。该命令会连接到远程主机,并在远程主机上执行if语句,判断是否存在指定文件。如果存在,则输出"File exists",否则输出"File does not exist"。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)