Files
mkdocs/docs/Linux/curl.md
2025-03-25 15:52:48 +01:00

1.8 KiB

curl

Envoyer un fichier sur un ftp (Photomanager iPad):

curl -T /Users/bruno/Pictures/_Canon/Export/2023/Janvier/2023-01-21_FauconPelerin_0518.jpg ftp://192.168.2.112:2121 -u anonymous:

Envoyer plusieurs fichiers sur un ftp (funnymac):

find /Users/bruno/Pictures/_Canon/Export/2023/Janvier/ -type f | xargs -L 1 bash -c '/opt/homebrew/opt/curl/bin/curl --user funnymac:a3XELN4PHTYF9fFHtsY97eshXBxxFo -T $1 sftp://ftp.cluster011.ovh.net:22/home/funnymac/www/ftp/${1##*/}' \;
for file in /folder/path/*
do
  curl -u username:password -T ${file} http://www.example.com/folder/${file}
done
# Si le dossier juin n'existe pas sur le ftp, on le crée:

find /Users/bruno/Desktop/Juin -type f | xargs -L 1 bash -c '/opt/homebrew/opt/curl/bin/curl --user funnymac:a3XELN4PHTYF9fFHtsY97eshXBxxFo --ftp-create-dirs -T $1 sftp://ftp.cluster011.ovh.net:22/home/funnymac/www/ftp/juin/${1##*/}' \;

Télécharger un fichier depuis un ftp (funnymac):

/opt/homebrew/opt/curl/bin/curl --user funnymac:a3XELN4PHTYF9fFHtsY97eshXBxxFo -O sftp://ftp.cluster011.ovh.net:22/home/funnymac/8_2022.jpg

Télécharger plusieurs fichiers depuis un ftp (funnymac):

/opt/homebrew/opt/curl/bin/curl --user funnymac:a3XELN4PHTYF9fFHtsY97eshXBxxFo -T '{2023-01-31_RuBlanc_0627,2023-01-31_RuBlanc_0623}.jpg' sftp://ftp.cluster011.ovh.net:22/home/funnymac/www/ftp/ \;

Rendre curl silencieux:

Masquer erreurs et barre de progression:
curl -s https://google.com
Complètement silencieux:
curl -s -o /dev/null https://google.com
Afficher juste les erreurs:
curl -S -s -o /dev/null https://google.com

Options:

-Z, --parallel
-#, --progress-bar
-Q, --quote <command>
-S, --show-error
-s, --silent