문제
어떻게 사용할 수 있습니까? grep
그리고 ls
FTP 클라이언트에서 ...
내가 사용할 수있는 특정 파일을 찾고 싶다면 다음을 의미합니다.
ls -l | grep pattern
해결책
LFTP 당신이 타이핑 한 방식을 정확히 할 수 있습니다.
다른 팁
일반적인 UNIX CommandLine 대화식 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 결과를 먼저 로컬 파일로 가져오고 그 다음에 로컬로 Grep을 실행하십시오. 덧붙여서, 이것은 단 하나의 비용을 지불 한 후 여러 greps를 실행할 수 있습니다. dir
데이터 전송 ;-).
Windows에서는이 작업을 수행 할 수 있습니다 WinSCP 스크립팅 FTP를 포함한 모든 프로토콜의 경우 :
winscp.com /command ^
"open ftp://username:password@example.com" ^
"ls /path/*.txt" ^
"exit"
참조 :
https://winscp.net/eng/docs/scripting
https://winscp.net/eng/docs/scriptcommand_ls
제휴하지 않습니다 StackOverflow