通过命令行发送文件通过FTP而不用交互模式

我想通过使用命令行(在Linux上)通过FTP自动发送文件。 通过这个我的意思是我想直接从命令行发送文件,没有任何交互模式。 我想从命令行传递所有参数(为了私人目的,它在本地networking上,所以在命令行上input密码对我来说是很好的)。 我知道我要发送什么文件,以及我要存储的位置。 到目前为止,我的google-fu已经失败了,因为关于“命令行ftp”的所有指南实际上正在进入交互式文本界面,这不是我想要的。

那么如果我不想进入交互模式,并且想通过命令行传递所有参数,那么我怎么通过FTP发送一个文件呢?

如果可能的话,安装ncftp并使用ncftpputncftpget命令来上传和下载文件。

lftp还具有-c (从命令行参数读取FTP命令)和-f (从文本文件读取FTP命令)选项,可以帮助您自动执行FTP会话。

如果你真的不得不使用古老的ftp命令,你可以使用expect (或者autoexpect )。

LFTP?

 $ yum info lftp Loaded plugins: priorities, ps Available Packages Name : lftp Arch : i686 Version : 4.0.9 Release : 1.el6 Size : 735 k Repo : base Summary : A sophisticated file transfer program URL : http://lftp.yar.ru/ License : GPLv3+ Description : LFTP is a sophisticated ftp/http file transfer program. Like bash, it has job : control and uses the readline library for input. It has bookmarks, built-in : mirroring, and can transfer several files in parallel. It is designed with : reliability in mind. 

手册页在这里: http : //lftp.yar.ru/lftp-man.html

安装ncftp并使用utitilies ncftpputncftpget