Pergunta

Is it possible to use regex for matching file names in FTP to get files from server ?

I need to do FTP to server and need to download the files whose file names are ending with the same value. In my case, it is 14_04_25_144238.

I am not sure if it is doable. But, just out of curiosity, asking this.

Can we use regex like .*14_04_25_144238 in the ftp get command ?

Thanks in advance. Dinesh S

Foi útil?

Solução

You want the mget command.

From the Unix man page

mget remote-files

Expand the remote-files on the remote machine and do a get for each file name thus produced. See glob for details on the filename expansion. Resulting file names will then be processed according to case, ntrans, and nmap settings. Files are transferred into the local working directory, which can be changed with 'lcd directory'; new local directories can be created with '! mkdir directory'.

If you want to turn of the prompting of each file, then you also need this:

prompt

Toggle interactive prompting. Interactive prompting occurs during multiple file transfers to allow the user to selectively retrieve or store files. If prompting is turned off (default is on), any mget or mput will transfer all files, and any mdelete will delete all files

.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top