当前位置: 首页 > 科技观察

推荐一款GitHubstar11.5K命令行文件传输神器(开源免费,支持10GB大文件)

时间:2023-03-17 17:29:28 科技观察

在工作和生活中,我们经常需要在不同设备之间传输文件,但是经常会遇到需要安装的问题第三方软件,文件大小限制,传输速度慢等安装第三方软件还好,但是限制传输速度和文件大小就恶心了。如果你使用它,你将不得不充值和支付。否则,紧急传送一些东西,会耗费大量的时间和精力。1软件介绍从命令行轻松快速地共享文件。当然,我们也可以使用旧的百度云盘(非会员限速),Dropbox(速度很慢)和GoogleDrive(需要科学上网),新的进口阿里云盘(虽然没有限速,但是上传不能加速),MilkCowExpress(总文件大小有限制)。但是我们这里要介绍的是一个基于命令行的文件传输工具——transfer.sh。专为与shell一起使用使用URL共享文件免费上传最多10GB文件存储14天加密您的文件最大限度地提高下载量2使用方式示例用例[1]命令执行使用#将shell函数添加到.bashrc或。zshrc文件中transfer(){if[$#-eq0];thenecho"Noargumentsspecified."echo"Usage:"echo"transfer...|transfer"return1fiiftty-s;thenfile="$1"file_name=$(basename"$file")if[!-e"$file"];thenecho"$file:Nosuchfileordirectory"return1fiif[-d"$file"];thenfile_name="$file_name.zip"(cd"$file"&&zip-r-q-.)|curl--progress-bar--upload-file"-""https://transfer.sh/$file_name"|tee/dev/nullelsecat"$file"|curl--progress-bar--upload-file"-""https://transfer.sh/$file_name"|tee/dev/nullfielsefile_name="$1"curl--progress-bar--upload-file"-""https://transfer.sh/$file_name"|tee/dev/nullfi}#现在可以使用函数上传文件$transferhello.txt[2]简单上传文件-官方支持接口上传#使用curl命令上传文件$curl--upload-file./hello.txthttps://transfer.sh/hello.txthttps://transfer.sh/66nb8/hello.txt#上传文件设置最大下载次数和过期时间$curl-H"Max-Downloads:1"-H"Max-Days:5"--upload-file./hello.txthttps://transfer.sh/hello.txthttps://transfer.sh/66nb8/hello.txt#Downloadfile$curlhttps://transfer.sh/66nb8/hello.txt-ohello.txt#也支持wget上传文件$wget--methodPUT--body-file=/tmp/file.tarhttps://transfer.sh/file.tar-O--nv#同时支持HTTPie上传文件$httphttps://transfer.sh/-vvinvoke-webrequest-方法put-infile.\file.txthttps://transfer.sh/file.txt[3]一次上传多个文件#使用filedata执行文件地址$curl-i-Ffiledata=@/tmp/hello.txt-菲力达ta=@/tmp/hello2.txthttps://transfer.sh/#合并下载到zip或tar压缩包$curlhttps://transfer.sh/(15HKz/hello.txt,15HKz/hello.txt).tar.gz$curlhttps://transfer.sh/(15HKz/hello.txt,15HKz/hello.txt).zip[4]传输前加密你的文件#usegpg加密文件$cat/tmp/hello.txt|gpg-ac-o-|curl-XPUT--upload-file"-"https://transfer.sh/test.txt#下载解密$curlhttps://transfer.sh/1lDau/test.txt|gpg-o->/tmp/hello.txt#使用openssl加密文件$cat/tmp/hello.txt|opensslaes-256-cbc-pbkdf2-e|curl-XPUT--上传文件"-"https://transfer.sh/test.txt#下载解密$curlhttps://transfer.sh/1lDau/test.txt|opensslaes-256-cbc-pbkdf2-d>/tmp/hello.txt#Importkeyfromkeybase$keybasetrack[them]#加密文件$catsomebackupfile.tar.gz|keybaseencrypt[them]|curl--upload-file'-'https://transfer.sh/test.txt#Decryption下载$curlhttps://transfer.sh/sqUFi/test.md|keybasedecrypt[5]扫描恶意软件#使用Clamav扫描恶意软件或病毒$wgethttp://www.eicar.org/download/eicar.com$curl-XPUT--upload-file./eicar.comhttps://transfer.sh/eicar.com/scan#上传恶意软件到VirusTotal并获得永久链接$curl-XPUT--upload-filenhgbhhjhttps://transfer.sh/test.txt/virustotal[6]加密传输备份mysql数据库#backup+encryption+transfer$mysqldump--all-databases|gzip|gpg-ac-o-|curl-XPUT--upload-file"-"https://transfer.sh/test.txt[7]发送带传输链接的电子邮件#transferandsendemailwithlink$transfer/tmp/hello.txt|mail-s"HelloWorld"user@yourmaildomain.com[8]传输日志文件#grepsyslogforpoundandtransfer$cat/var/log/syslog|greppound|curl--upload-file-https://transfer.sh/pound.log