在 FTP 客户端中使用 grep 和 ls?
我如何在 FTP 客户端中使用 grep
和 ls
...
我的意思是如果我想找到一些可以使用的特定文件:
ls -l | grep pattern
How could I use grep
and ls
in FTP client...
I mean if I want to find some specific file I could use:
ls -l | grep pattern
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
对于通常的 Unix 命令行交互式 ftp,一种方法是:
即,首先将 dir 结果放入本地文件,然后在本地运行 grep。顺便说一句,这可以让您在支付一次
dir
数据传输费用后运行多个 grep;-)。With the usual Unix commandline interactive ftp, one approach is:
i.e., get the dir results into a local file first, then run grep locally. Incidentally, this lets you run multiple greps after paying for just one
dir
data transfer;-).lftp 可以,就像您输入的方式一样。
lftp can, exactly the way you typed.
在 Windows 上,您可以使用任何协议(包括 FTP)的 WinSCP 脚本 来执行此操作:
参考:
https://winscp.net/eng/docs/scripting
https://winscp.net/eng/docs/scriptcommand_ls
On Windows, you can do this with WinSCP scripting for any protocol, including the FTP:
References:
https://winscp.net/eng/docs/scripting
https://winscp.net/eng/docs/scriptcommand_ls
您可以将 sftp 文件夹挂载到有权使用 grep 或任何工具的主机。
You can mount an sftp folder to a host where you have permissions to use grep or any tool.