This is an old revision of the document!


Lets look at how we can do it with curl.

Заходим на ftp и смотрим что там есть:

curl ftp://myftpsite.com --user myname:mypassword 


Скачиваем файл с сервера:

curl ftp://myftpsite.com/mp3/mozart_piano_sonata.zip --user myname:mypassword -o mozart_piano_sonata.zip 


Закачиваем файл на сервер:

curl -T koc_dance.mp3 ftp://myftpsite.com/mp3/ --user myname:mypassword


Смотрим файлы в поддиректориях:

curl ftp://myftpsite.com/mp3/  --user myname:mypassword

Листиниг только директорий:

curl ftp://myftpsite.com  --user myname:mypassword -s | grep ^d


Удаляем файл с сервера. Подтверждения не спрашивает!!:
This is a bit tricky, because curl do not support that by default, well anyway, you can make use of -X and pass in the REAL FTP command.
(Check out a list of FTP service Command in rfc 959, under 4.1.3. FTP SERVICE COMMANDS)

curl ftp://myftpsite.com/ -X 'DELE mp3/koc_dance.mp3' --user myname:mypassword
Enter your comment. Wiki syntax is allowed:
 
  • linux_faq/использование-curl.1549876407.txt
  • Last modified: 2019/02/11 09:13
  • by 127.0.0.1