我怎样才能使用grep
and ls
在 FTP 客户端...
我的意思是,如果我想找到一些可以使用的特定文件:
ls -l | grep pattern
对于通常的 Unix 命令行交互式 ftp,一种方法是:
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir . foobar
output to local-file: foobar [anpqy?]? y
500 Unknown command
227 Entering Passive Mode (62,149,140,15,195,159)
150 Accepted data connection
11966 5.26 KB/s
226-Options: -a -l
226 156 matches total
ftp> !grep con foobar
-rwxr-xr-x 1 11050207 users 911007 Sep 13 2007 accu_pyconc.pdf
-rwxr-xr-x 1 11050207 users 9805405 Mar 25 2009 pycon_abst.pdf
即,首先将 dir 结果放入本地文件中,then在本地运行 grep 。顺便说一句,这可以让你在只支付一个 grep 费用后运行多个 grepdir
数据传输;-)。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)