25-03-2025
This commit is contained in:
81
docs/Linux/curl.md
Normal file
81
docs/Linux/curl.md
Normal file
@@ -0,0 +1,81 @@
|
||||
# curl
|
||||
|
||||
#
|
||||
|
||||
#### Envoyer un fichier sur un ftp (Photomanager iPad):
|
||||
|
||||
```bash
|
||||
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):
|
||||
|
||||
```bash
|
||||
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##*/}' \;
|
||||
```
|
||||
|
||||
```bash
|
||||
for file in /folder/path/*
|
||||
do
|
||||
curl -u username:password -T ${file} http://www.example.com/folder/${file}
|
||||
done
|
||||
```
|
||||
|
||||
```bash
|
||||
# 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):
|
||||
|
||||
```bash
|
||||
/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):
|
||||
|
||||
```bash
|
||||
/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:
|
||||
|
||||
```bash
|
||||
curl -s https://google.com
|
||||
```
|
||||
|
||||
##### Complètement silencieux:
|
||||
|
||||
```bash
|
||||
curl -s -o /dev/null https://google.com
|
||||
```
|
||||
|
||||
##### Afficher juste les erreurs:
|
||||
|
||||
```bash
|
||||
curl -S -s -o /dev/null https://google.com
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Options:
|
||||
|
||||
```
|
||||
-Z, --parallel
|
||||
-#, --progress-bar
|
||||
-Q, --quote <command>
|
||||
-S, --show-error
|
||||
-s, --silent
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user