How to Upload a File on Shell

Piece of cake file sharing from the command line

# Upload using gyre $ curl --upload-file ./hello.txt https://transfer.sh/hullo.txt https://transfer.sh/zddqck/hello.txt # Using the shell office $ transfer hello.txt ##################################################### 100.0% https://transfer.sh/vF5EWG/hello.txt

Fabricated for use with shell

Share files with a URL

Unlimited upload

Files stored for 336h0m0s

For free

Encrypt your files

Maximize amount of downloads

Sample use cases

How to upload

# Uploading is easy using curl $ whorl --upload-file ./hello.txt https://transfer.sh/hello.txt https://transfer.sh/zddqck/hello.txt $ curl -H "Max-Downloads: i" -H "Max-Days: 5" --upload-file ./hello.txt https://transfer.sh/how-do-you-do.txt https://transfer.sh/zddqck/how-do-you-do.txt # Download the file $ curlicue https://transfer.sh/zddqck/hello.txt -o hello.txt

Add shell part to .bashrc or .zshrc

# Add this to .bashrc or .zshrc or its equivalent transfer(){ if [ $# -eq 0 ];then echo "No arguments specified.\nUsage:\northward transfer <file|directory>\due north ... | transfer <file_name>">&ii;render 1;fi;if tty -s;and so file="$1";file_name=$(basename "$file");if [ ! -e "$file" ];and so echo "$file: No such file or directory">&2;return 1;fi;if [ -d "$file" ];and then file_name="$file_name.zip" ,;(cd "$file"&&aught -r -q - .)|curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null,;else cat "$file"|ringlet --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null;fi;else file_name=$ane;curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/nix;fi;} # Now you can apply transfer part $ transfer hello.txt

More examples

Upload multiple files at once

$ curl -i -F filedata=@/tmp/hullo.txt -F filedata=@/tmp/hello2.txt https://transfer.sh/ # Combining downloads every bit zero or tar archive $ coil https://transfer.sh/(zddqck/hullo.txt,vF5EWG/world.txt).tar.gz $ curl https://transfer.sh/(zddqck/hullo.txt,vF5EWG/globe.txt).goose egg

Encrypt your files with gpg before the transfer

# Encrypt files with password using gpg $ cat /tmp/howdy.txt|gpg -ac -o-|scroll -X PUT --upload-file "-" https://transfer.sh/test.txt # Download and decrypt $ curl https://transfer.sh/zddqck/exam.txt|gpg -o- > /tmp/hello.txt

Browse for malware

# Browse for malware or viruses using Clamav $ wget http://www.eicar.org/download/eicar.com $ curl -X PUT --upload-file ./eicar.com https://transfer.sh/eicar.com/scan # Upload malware to VirusTotal, become a permalink in render $ curl -X PUT --upload-file nhgbhhj https://transfer.sh/test.txt/virustotal

Fill-in mysql database, encrypt and transfer

# Backup, encrypt and transfer $ mysqldump --all-databases|gzip|gpg -ac -o-|curl -X PUT --upload-file "-" https://transfer.sh/exam.txt

Send email with transfer link (uses shell function)

# Transfer and send email with link (uses shell part) $ transfer /tmp/hi.txt | mail service -south "Hullo World" user@yourmaildomain.com

Using Keybase.io

# Import keys from keybase $ keybase rail [them] # Encrypt for recipient(south) $ cat somebackupfile.tar.gz | keybase encrypt [them] | curl --upload-file '-' https://transfer.sh/test.txt # Decrypt $ roll https://transfer.sh/zddqck/test.dr. |keybase decrypt

wget uploads also supported

# wget $ wget --method PUT --body-file=/tmp/file.tar https://transfer.sh/file.tar -O - -nv

Transfer pound logs

# grep syslog for pound and transfer $ cat /var/log/syslog|grep pound|curl --upload-file - https://transfer.sh/pound.log

Upload a file using Powershell

# Upload using Powershell PS H:\> invoke-webrequest -method put -infile .\file.txt https://transfer.sh/file.txt

Upload a file using HTTPie

# HTTPie $ http https://transfer.sh/ -vv < /tmp/test.log

Upload a file using Unofficially client in Python

# transfersh-cli (https://github.com/tanrax/transfersh-cli) $ transfersh photos.nothing # Uploading file # Download from here: https://transfer.sh/zddqck/photos.zip # It has also been copied to the clipboard!

Encrypt your files with openssl before the transfer

# Encrypt files with password using openssl $ cat /tmp/hi.txt|openssl aes-256-cbc -pbkdf2 -e|curl -X PUT --upload-file "-" https://transfer.sh/test.txt # Download and decrypt $ curl https://transfer.sh/zddqck/test.txt|openssl aes-256-cbc -pbkdf2 -d > /tmp/hi.txt

Upload a file or directory in Windows

#Salve this as transfer.cmd in Windows 10 (which has ringlet.exe) @repeat off setlocal EnableDelayedExpansion EnableExtensions goto main :usage echo No arguments specified. >&two echo Usage: >&2 echo transfer ^<file^|directory^> >&2 repeat ... ^| transfer ^<file_name^> >&2 exit /b 1 :master if "%~ane" == "" goto usage timeout.exe /t 0 >nul 2>nul || goto not_tty ready "file=%~1" for %%A in ("%file%") practice set "file_name=%%~nxA" if exist "%file_name%" goto file_exists echo %file%: No such file or directory >&2 leave /b ane :file_exists if not exist "%file%\" goto not_a_directory set "file_name=%file_name%.zilch" pushd "%file%" || exit /b one set "full_name=%temp%\%file_name%" powershell.exe -Command "Get-ChildItem -Path . -Recurse | Compress-Archive -DestinationPath ""%full_name%""" ringlet.exe --progress-bar --upload-file "%full_name%" "https://transfer.sh/%file_name%" popd goto :eof :not_a_directory curl.exe --progress-bar --upload-file "%file%" "https://transfer.sh/%file_name%" goto :eof :not_tty set up "file_name=%~1" ringlet.exe --progress-bar --upload-file - "https://transfer.sh/%file_name%" goto :eof

Transport united states of america your awesome example

# Your awesome sample will be put here

Fork me on GitHub

barnabycinceres.blogspot.com

Source: https://transfer.sh/

0 Response to "How to Upload a File on Shell"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel